-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build] explicitly set OSX_ARCHITECTURES for targets in stdlib #38415
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
[build] explicitly set OSX_ARCHITECTURES for targets in stdlib #38415
Conversation
Our custom build code already sets the architecture of compilation commands by different means, and so far we were relying on setting `CMAKE_OSX_ARCHITECTURES` to an empty value to avoid CMake doing the same. However, on Apple Silicon, CMake 3.19+ enforces a default value in this scenario (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs), and this would result in the inability to compile code for x86_64. Addresses SR-14035, rdar://80613594
@swift-ci please test |
@swift-ci test Apple Silicon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments seem to be wrapped oddly, but the change itself LGTM.
@swift-ci please test Windows |
The preset |
The macOS platform tests show that, as a result of this change, the architecture parameter is specified twice and it has the same value (which is a good indicator of what would happen for a build on Apple Silicon without
|
@swift-ci please test Windows |
Takes review feedback from swiftlang#38415
Our custom build code already sets the architecture of compilation commands by different means, and so far we were relying on setting `CMAKE_OSX_ARCHITECTURES` to an empty value to avoid CMake doing the same. However, on Apple Silicon, CMake 3.19+ enforces a default value in this scenario (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs), and this would result in the inability to compile code for x86_64. Cherry-pick of swiftlang#38415, swiftlang#38444 Addresses SR-14035, rdar://80699579
Takes review feedback from #38415
Previously we were setting `-arch` explicitly and unsetting `CMAKE_OSX_ARCHITECTURES`; however this approach does not work when building on Apple Silicon, since in there CMake 3.19+ enforces a default value (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs), and this would result in the inability to compile code for x86_64. This is a similar approach used for stdlib targets in swiftlang#38415 Addresses rdar://88100025
Previously we were setting `-arch` explicitly and unsetting `CMAKE_OSX_ARCHITECTURES`; however this approach does not work when building on Apple Silicon, since in there CMake 3.19+ enforces a default value (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs), and this would result in the inability to compile code for x86_64. This is a similar approach used for stdlib targets in #38415 Addresses rdar://88100025
This way we configure correctly `libBlocksRuntime`, which is not using `add_swift_target_library` (where the code for setting `OSX_ARCHITECTURES` currently lives, see swiftlang#38415 and swiftlang#38956) Addresses rdar://96469791
…wiftlang#59922) This way we configure correctly `libBlocksRuntime`, which is not using `add_swift_target_library` (where the code for setting `OSX_ARCHITECTURES` currently lives, see swiftlang#38415 and swiftlang#38956) Addresses rdar://96469791
Rely instead on setting the `OSX_ARCHITECTURES` property (swiftlang#38415) Address rdar://96087734
The underlying issue that required restricting to `arm64` has been fixed in swiftlang#38415 Addresses rdar://77191256
The underlying issue that required restricting to `arm64` has been fixed in #38415 Addresses rdar://77191256
Our custom build code already sets the architecture of compilation
commands by different means, and so far we were relying on setting
CMAKE_OSX_ARCHITECTURES
to an empty value to avoid CMake doing thesame.
However, on Apple Silicon, CMake 3.19+ enforces a default value in this
scenario
(https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs),
and this would result in the inability to compile code for x86_64.
Addresses SR-14035, rdar://80613594