Better Architecture detection strategy if compiling on Apple Silicon

This commit is contained in:
Jeff Hutchinson 2021-11-06 22:56:05 -04:00
parent 8293ac7b49
commit 3fdd7266e3

View file

@ -745,8 +745,7 @@ if (APPLE AND NOT IOS)
set(ARCHITECTURE_STRING_APPLE "x86_64;arm64")
set(DEPLOYMENT_TARGET_APPLE "10.13")
else()
check_c_compiler_flag("-arch arm64" armSupportedApple)
if(armSupportedApple)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(ARCHITECTURE_STRING_APPLE "arm64")
set(DEPLOYMENT_TARGET_APPLE "11.0")
else()