Files
CMake/Modules
Brad King 5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts
Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect
that we are running on Apple Silicon in a way that pierces Rosetta.
This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such
hosts.  However, macOS offers strong support for running processes under
an emulated `x86_64` architecture.

Teach CMake to select either `arm64` or `x86_64` as the host
architecture on Apple Silicon based on the architecture of its own
process.  When CMake is built as a universal binary, macOS will select
whichever slice (architecture) is appropriate under the user's shell,
and `CMAKE_HOST_SYSTEM_PROCESSOR` will match.

Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment
variable to provide users with explicit control over the host
architecture selection regardless of CMake's own architecture.

Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to
the toolchain to use selected host architecture instead of letting the
toolchain pick.

Fixes: #21554
2020-12-10 12:08:13 -05:00
..
2020-09-30 08:05:50 -04:00
2020-07-02 00:37:34 +05:30
2020-11-02 09:39:36 -05:00
2020-07-02 00:38:40 +05:30
2020-07-02 00:43:40 +05:30
2020-07-07 09:22:28 -04:00
2020-07-07 09:22:28 -04:00
2020-07-02 00:40:09 +05:30
2020-07-01 10:55:32 -04:00
2020-07-02 00:44:08 +05:30
2020-10-02 16:17:36 +02:00
2020-07-27 10:43:55 -04:00

See the "Find Modules" section of the cmake-developer(7) manual page.

For more information about how to contribute modules to CMake, see this page:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/dev/Module-Maintainers