Skip to content

Commit

Permalink
Compiler detection: Cache compiler hash: Set compiler file hash cache…
Browse files Browse the repository at this point in the history
… variable (#1558)
  • Loading branch information
autoantwort authored Jan 16, 2025
1 parent 52e8ac9 commit 89068dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/vcpkg/base/contractual-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ namespace vcpkg
inline constexpr StringLiteral FileBaselineDotJson = "baseline.json";
inline constexpr StringLiteral FileBin = "bin";
inline constexpr StringLiteral FileControl = "CONTROL";
inline constexpr StringLiteral FileCompilerFileHashCacheDotJson = "compiler-file-hash-cache.json";
inline constexpr StringLiteral FileCopying = "COPYING";
inline constexpr StringLiteral FileCopyright = "copyright";
inline constexpr StringLiteral FileDebug = "debug";
Expand Down Expand Up @@ -377,6 +378,7 @@ namespace vcpkg
inline constexpr StringLiteral CMakeVariableCMakeSystemName = "VCPKG_CMAKE_SYSTEM_NAME";
inline constexpr StringLiteral CMakeVariableCMakeSystemVersion = "VCPKG_CMAKE_SYSTEM_VERSION";
inline constexpr StringLiteral CMakeVariableCmd = "CMD";
inline constexpr StringLiteral CMakeVariableCompilerCacheFile = "VCPKG_COMPILER_CACHE_FILE";
inline constexpr StringLiteral CMakeVariableConcurrency = "VCPKG_CONCURRENCY";
inline constexpr StringLiteral CMakeVariableCurrentBuildtreesDir = "CURRENT_BUILDTREES_DIR";
inline constexpr StringLiteral CMakeVariableCurrentPackagesDir = "CURRENT_PACKAGES_DIR";
Expand Down
1 change: 1 addition & 0 deletions include/vcpkg/installedpaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace vcpkg
Path vcpkg_dir_status_file() const { return vcpkg_dir() / FileStatus; }
Path vcpkg_dir_info() const { return vcpkg_dir() / FileInfo; }
Path vcpkg_dir_updates() const { return vcpkg_dir() / FileUpdates; }
Path compiler_hash_cache_file() const { return vcpkg_dir() / FileCompilerFileHashCacheDotJson; }
Path lockfile_path() const { return vcpkg_dir() / FileVcpkgLock; }
Path triplet_dir(Triplet t) const { return m_root / t.canonical_name(); }
Path share_dir(const PackageSpec& p) const { return triplet_dir(p.triplet()) / FileShare / p.name(); }
Expand Down
2 changes: 2 additions & 0 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,9 @@ namespace vcpkg
paths.packages() / fmt::format("{}_{}", FileDetectCompiler, triplet.canonical_name())},
// The detect_compiler "port" doesn't depend on the host triplet, so always natively compile
{CMakeVariableHostTriplet, triplet.canonical_name()},
{CMakeVariableCompilerCacheFile, paths.installed().compiler_hash_cache_file()},
};

get_generic_cmake_build_args(paths, triplet, toolset, cmake_args);

auto cmd = vcpkg::make_cmake_cmd(paths, paths.ports_cmake, std::move(cmake_args));
Expand Down

0 comments on commit 89068dd

Please sign in to comment.