diff options
Diffstat (limited to 'src/buildtool/execution_api/local/config.hpp')
-rw-r--r-- | src/buildtool/execution_api/local/config.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/buildtool/execution_api/local/config.hpp b/src/buildtool/execution_api/local/config.hpp index 71a4941e..4c991264 100644 --- a/src/buildtool/execution_api/local/config.hpp +++ b/src/buildtool/execution_api/local/config.hpp @@ -98,13 +98,16 @@ class LocalExecutionConfig { } // CAS directory based on the type of the file. - // Specialized just for regular File or Exectuable - template <ObjectType kType, - typename = std::enable_if<kType == ObjectType::File or - kType == ObjectType::Executable>> + template <ObjectType kType> [[nodiscard]] static inline auto CASDir() noexcept -> std::filesystem::path { - static const std::string kSuffix = std::string{"cas"} + ToChar(kType); + char t = ToChar(kType); + if constexpr (kType == ObjectType::Tree) { + if (Compatibility::IsCompatible()) { + t = ToChar(ObjectType::File); + } + } + static const std::string kSuffix = std::string{"cas"} + t; return CacheRoot() / kSuffix; } |