#include <core/types.hpp>
#include <core/wincompat.hpp>
+#include <storage/Storage.hpp>
#include <util/expected.hpp>
#include <util/path.hpp>
#include <util/string.hpp>
See also the manual on <https://ccache.dev/documentation.html>.
)";
-constexpr const char FEATURE_TEXT[] =
- "http-storage"
-#ifdef HAVE_REDIS_STORAGE_BACKEND
- " redis-storage"
-#endif
- ;
-
// This is a string that identifies the current "version" of the hash sum
// computed by ccache. If, for any reason, we want to force the hash sum to be
// different for the same input in a new ccache version, we can just change
}
case 'V': // --version
- PRINT(VERSION_TEXT, CCACHE_NAME, CCACHE_VERSION, FEATURE_TEXT);
+ PRINT(VERSION_TEXT, CCACHE_NAME, CCACHE_VERSION, storage::get_features());
exit(EXIT_SUCCESS);
case 'x': // --show-compression
#include <algorithm>
#include <unordered_map>
+#include <vector>
namespace storage {
#endif
};
+std::string
+get_features()
+{
+ std::vector<std::string> features;
+ features.reserve(k_secondary_storage_implementations.size());
+ std::transform(k_secondary_storage_implementations.begin(),
+ k_secondary_storage_implementations.end(),
+ std::back_inserter(features),
+ [](auto& entry) { return FMT("{}-storage", entry.first); });
+ std::sort(features.begin(), features.end());
+ return util::join(features, " ");
+}
+
struct SecondaryStorageConfig
{
secondary::SecondaryStorage::Backend::Params params;