Merge pull request #999 from jbatez/dev

support MI_OPT_ARCH when targeting multiple CMAKE_OSX_ARCHITECTURES
This commit is contained in:
Daan 2025-02-08 11:46:07 -08:00 committed by GitHub
commit cb2719cdb8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194

View file

@ -425,7 +425,9 @@ endif()
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU|Intel" AND NOT CMAKE_SYSTEM_NAME MATCHES "Haiku")
if(MI_OPT_ARCH)
if(MI_ARCH STREQUAL "arm64")
if(APPLE AND "arm64" IN_LIST CMAKE_OSX_ARCHITECTURES)
set(MI_OPT_ARCH_FLAGS "-Xarch_arm64" "-march=armv8.1-a")
elseif(MI_ARCH STREQUAL "arm64")
set(MI_OPT_ARCH_FLAGS "-march=armv8.1-a") # fast atomics
endif()
endif()