Let CMake autodetect Apple arch on M1 processor

This commit is contained in:
Pawel Paruzel 2021-12-05 13:21:17 +01:00 committed by Lukas Dürrenberger
parent e53d9e88a9
commit d0ebdc8607

View File

@ -25,11 +25,6 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.9)
cmake_policy(SET CMP0068 NEW) cmake_policy(SET CMP0068 NEW)
endif() endif()
# add some default value for some additional macOS variable
# note that those variables are ignored on other systems
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "macOS architecture to build; 64-bit is expected" FORCE)
endif()
if(NOT CMAKE_OSX_SYSROOT) if(NOT CMAKE_OSX_SYSROOT)
# query the path to the default SDK, will fail on non-macOS, but it's okay. # query the path to the default SDK, will fail on non-macOS, but it's okay.
execute_process(COMMAND xcodebuild -sdk macosx -version Path execute_process(COMMAND xcodebuild -sdk macosx -version Path