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

Compiler detection: Cache compiler hash #42994

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

autoantwort
Copy link
Contributor

@autoantwort autoantwort commented Dec 30, 2024

Implements microsoft/vcpkg-tool#362 (comment)
Speeds up the compiler hashing if the compiler file is large like on macOS (250 MB for cc and c++ each)
image

@Mengna-Li Mengna-Li added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Dec 30, 2024
@Mengna-Li Mengna-Li added the info:reviewed Pull Request changes follow basic guidelines label Jan 2, 2025
@JavierMatosD JavierMatosD added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Jan 3, 2025
set(${out_var} "${HASH}" PARENT_SCOPE)
endfunction()

if(VCPKG_COMPILER_CACHE_FILE)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be

Suggested change
if(VCPKG_COMPILER_CACHE_FILE)
if(DEFINED VCPKG_COMPILER_CACHE_FILE)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. The variable is passed to this port by -DVCPKG_COMPILER_CACHE_FILE=${VCPKG_COMPILER_CACHE_FILE}, but if an "old" vcpkg-tool is used the variable is not defined in the portfile and an empty variable gets defined.

scripts/detect_compiler/CMakeLists.txt Outdated Show resolved Hide resolved
scripts/detect_compiler/CMakeLists.txt Outdated Show resolved Hide resolved
scripts/detect_compiler/CMakeLists.txt Outdated Show resolved Hide resolved
scripts/detect_compiler/CMakeLists.txt Outdated Show resolved Hide resolved
scripts/detect_compiler/CMakeLists.txt Show resolved Hide resolved
@@ -18,6 +18,8 @@ set(VCPKG_BUILD_TYPE release)
vcpkg_configure_cmake(
SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}"
PREFER_NINJA
OPTIONS
-DVCPKG_COMPILER_CACHE_FILE=${VCPKG_COMPILER_CACHE_FILE}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-DVCPKG_COMPILER_CACHE_FILE=${VCPKG_COMPILER_CACHE_FILE}
"-DVCPKG_COMPILER_CACHE_FILE=${VCPKG_COMPILER_CACHE_FILE}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly info:reviewed Pull Request changes follow basic guidelines requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants