Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set compiler file hash cache variable #1558

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/vcpkg/base/contractual-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,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";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't put it here initially because you could put the file anywhere and wouldn't break anyone. I don't know what the exact rule is (when to put stuff in this header and when not).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea is that any 'magic names' should go in here. This thing mostly exists to prevent typoing the name should we need to reference it somewhere else again, at least that's my understanding based on @ras0219-msft 's feedback that created this header in the first place.

inline constexpr StringLiteral FileCopying = "COPYING";
inline constexpr StringLiteral FileCopyright = "copyright";
inline constexpr StringLiteral FileDebug = "debug";
Expand Down Expand Up @@ -370,6 +371,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: 1 addition & 1 deletion src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ 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