diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake index d303b18fa812a9537e8185f4ec8571c81a921c97..e3ea37feff4532d53fbd3c4d5b20536d1e4e17ec 100644 --- a/cmake/CompilerOptions.cmake +++ b/cmake/CompilerOptions.cmake @@ -172,7 +172,9 @@ function(set_arch_target optvar arch) # Use -mcpu for all supported targets _except_ for x86, where it should be -march. - if(target_model MATCHES "x86|i[3456]86" OR target_model MATCHES "amd64" OR target_model MATCHES "aarch64") + if("${target}" MATCHES "aarch64-apple-darwin") + set(arch_opt "-mcpu=${arch}") + elseif(target_model MATCHES "x86|i[3456]86" OR target_model MATCHES "amd64" OR target_model MATCHES "aarch64") set(arch_opt "-march=${arch}") else() set(arch_opt "-mcpu=${arch}")