Apple M1: Only add x86 compile flags to x86 builds

- Removed -mssse3 flag from arm64 builds
- Removed -march=core2 from arm64 builds
This commit is contained in:
Skyler Saleh 2021-04-17 15:40:35 -07:00
parent bcb3c7d80f
commit 12c439860d
1 changed files with 4 additions and 3 deletions

View File

@ -314,9 +314,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
# Specify target CPUs. # Specify target CPUs.
if(_ARCH_64 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
check_and_add_flag(HAVE_MSSSE3 -mssse3) check_and_add_flag(HAVE_MSSSE3 -mssse3)
check_and_add_flag(HAVE_ARCH_CORE2 -march=core2) check_and_add_flag(HAVE_ARCH_CORE2 -march=core2)
endif()
# Linker flags. # Linker flags.
# Drop unreachable code and data. # Drop unreachable code and data.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")