CMake/Tests/RunCMake/AppleSilicon/x86_64-common.cmake
Brad King b7f0327dcd Tests: Cover macOS host architecture selection on Apple Silicon hosts
Add test cases verifying that `CMAKE_APPLE_SILICON_PROCESSOR` set as
either a cache or environment variable causes that to be selected as the
host architecture.  Also verify that sources compile using whatever is
selected as the host architecture, even when the explicit setting is not
used.

Issue: #21554
2020-12-10 12:08:15 -05:00

11 lines
362 B
CMake

enable_language(C)
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR is '${CMAKE_HOST_SYSTEM_PROCESSOR}', not 'x86_64'")
endif()
if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is '${CMAKE_OSX_ARCHITECTURES}', not empty ''")
endif()
add_library(x86_64 x86_64.c)