[scripts/get_cmake_vars][scripts/ports.cmake] fix CMake4 on OSX#44712
Merged
Conversation
It looks like CMake 4 may not always initialise CMAKE_OSX_SYSROOT, and `get_cmake_vars`/`z_vcpkg_get_cmake_vars` would fail if that happened. I simply fixed it the same way that the port `vcpkg_cmake_get_vars` does. Fixes microsoft#44697
Contributor
Author
|
@microsoft-github-policy-service terminate |
Contributor
Author
|
@microsoft-github-policy-service agree company="reMarkable AS" |
Contributor
Author
|
(I think I accidentally agreed on this account for myself, rather than as a paid contributor from reMarkable, so redoing the agreement) |
Contributor
Neumann-A
reviewed
Mar 31, 2025
CMake 4 broke compatiblity with CMake pre-3.5, so we need to set this variable to avoid ports which have an earlier cmake_minimum_required(VERSION) breaking.
Cheney-W
previously approved these changes
Apr 1, 2025
Contributor
|
The failure of |
Contributor
|
It looks like this PR would also partially address #44726 ? At least, the second commit will hide the error from vcpkg users. |
ADKaster
reviewed
Apr 1, 2025
BillyONeal
reviewed
Apr 1, 2025
BillyONeal
approved these changes
Apr 1, 2025
Member
|
Thanks for the fix! Related: #44273 has other fixes for 4.x but I think we should take this more targeted change to put out the current fire drill. |
ras0219-msft
approved these changes
Apr 1, 2025
7 tasks
This was referenced Apr 2, 2025
Cheney-W
approved these changes
Apr 2, 2025
This was referenced Apr 3, 2025
This was referenced Apr 3, 2025
Closed
3 tasks
kotori2
added a commit
to kotori2/vcpkg
that referenced
this pull request
Apr 30, 2025
…SX (microsoft#44712)" This reverts commit a1aebfa.
hebasto
added a commit
to hebasto/bitcoin
that referenced
this pull request
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It looks like CMake 4 may not always initialise CMAKE_OSX_SYSROOT, and
get_cmake_vars/z_vcpkg_get_cmake_varswould fail if that happened. I simply fixed it the same way that the portvcpkg_cmake_get_varsdoes.This additionally sets the environment variable
CMAKE_POLICY_VERSION_MINIMUMto4.0when using CMake 4.0, so that any ports that use an ancientcmake_minimum_requiredare taken care of.Fixes #44697