Skip to content

Fix build break with cmake 4.0 #114277

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

Merged
merged 1 commit into from
Apr 4, 2025
Merged

Conversation

akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Apr 4, 2025

cmake 4.0 no longer sets the CMAKE_OSX_SYSROOT variable for macOS targets (this includes Mac Catalyst): https://cmake.org/cmake/help/v4.0/release/4.0.html#other-changes

Builds targeting macOS no longer choose any SDK or pass an -isysroot flag to the compiler by default. Instead, compilers are expected to choose a default macOS SDK on their own. In order to use a compiler that does not do this, users must now specify -DCMAKE_OSX_SYSROOT=macosx when configuring their build.

We need to stop passing the variable to swiftc in that case and rely on the default behavior.

Fixes #114235
Fixes #114248

@Copilot Copilot AI review requested due to automatic review settings April 4, 2025 18:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt: Language not supported

cmake 4.0 no longer sets the CMAKE_OSX_SYSROOT variable for macOS targets: https://cmake.org/cmake/help/v4.0/release/4.0.html#other-changes

> Builds targeting macOS no longer choose any SDK or pass an -isysroot flag to the compiler by default. Instead, compilers are expected to choose a default macOS SDK on their own. In order to use a compiler that does not do this, users must now specify -DCMAKE_OSX_SYSROOT=macosx when configuring their build.

We need to stop passing the variable to swiftc in that case and rely on the default behavior.
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@steveisok steveisok requested a review from a team April 4, 2025 18:29
@akoeplinger
Copy link
Member Author

/backport to release/9.0-staging

@akoeplinger
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14271928222

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/14271930123

This comment was marked as outdated.

@akoeplinger
Copy link
Member Author

/ba-g failures are in non-osx jobs and can't be affected

@akoeplinger akoeplinger merged commit 283b64d into dotnet:main Apr 4, 2025
90 of 101 checks passed
@akoeplinger akoeplinger deleted the fix-cmake branch April 4, 2025 22:55
akoeplinger added a commit that referenced this pull request Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants