From 8e5fc236cab821d1e547e6a64a4f687b304c5e25 Mon Sep 17 00:00:00 2001 From: User Date: Sat, 30 Dec 2023 16:53:39 +1000 Subject: [PATCH] CMake: Fix building x86 on Apple Silicon --- cmake/BuildParameters.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 94d3baae10..6e47de852d 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -92,7 +92,10 @@ if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_HOST_SYSTEM_PR if (DISABLE_ADVANCE_SIMD) add_compile_options("-msse" "-msse2" "-msse4.1" "-mfxsr") else() - add_compile_options("-march=native") + # Can't use march=native on Apple Silicon. + if(NOT APPLE OR "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + add_compile_options("-march=native") + endif() endif() endif() else()