Skip to content

[CMake] set target architecture for Darwin idiomatically #41059

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

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Jan 28, 2022

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

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
@edymtt
Copy link
Contributor Author

edymtt commented Jan 28, 2022

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Jan 28, 2022

@swift-ci please test Apple Silicon

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - ae128bb

@edymtt
Copy link
Contributor Author

edymtt commented Jan 28, 2022

@swift-ci please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - ae128bb

@edymtt
Copy link
Contributor Author

edymtt commented Jan 31, 2022

@swift-ci please test macOS

@edymtt edymtt merged commit 64bc16a into swiftlang:main Jan 31, 2022
@edymtt edymtt deleted the host-tools-set-darwin-architectures-idiomatically branch January 31, 2022 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants