diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-04-16 14:32:35 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-04-17 11:04:04 +0200 |
commit | aef304900c79493112c9c3951fcfc00e4f3a58bf (patch) | |
tree | 868f415f61d03c52f2c0d7ee34a1b83d495e91d7 /src | |
parent | d083a2152aacc72a8c7462a523619d08fe3d2c0c (diff) | |
download | justbuild-aef304900c79493112c9c3951fcfc00e4f3a58bf.tar.gz |
Compactification: Obtain generation cache directories for compatibility modes.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/storage/config.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/buildtool/storage/config.hpp b/src/buildtool/storage/config.hpp index f0a13e96..c1151c3f 100644 --- a/src/buildtool/storage/config.hpp +++ b/src/buildtool/storage/config.hpp @@ -126,9 +126,12 @@ class StorageConfig { } /// \brief Storage directory of specific generation and protocol type. - [[nodiscard]] static auto GenerationCacheDir(std::size_t index) noexcept + [[nodiscard]] static auto GenerationCacheDir( + std::size_t index, + bool is_compatible = Compatibility::IsCompatible()) noexcept -> std::filesystem::path { - return UpdatePathForCompatibility(GenerationCacheRoot(index)); + return UpdatePathForCompatibility(GenerationCacheRoot(index), + is_compatible); } /// \brief String representation of the used execution backend. @@ -203,9 +206,9 @@ class StorageConfig { // different folder for different caching protocol [[nodiscard]] static auto UpdatePathForCompatibility( - std::filesystem::path const& dir) -> std::filesystem::path { - return dir / (Compatibility::IsCompatible() ? "compatible-sha256" - : "git-sha1"); + std::filesystem::path const& dir, + bool is_compatible) -> std::filesystem::path { + return dir / (is_compatible ? "compatible-sha256" : "git-sha1"); } }; |