CMake: Add DISABLE_SSE4 option

NOT recommended. Only if you ABSOLUTELY need it.

The SSE2/legacy build will be a separate download option, and
warn you if you try to run it on a CPU that supports SSE4.
This commit is contained in:
Stenzek
2024-09-23 19:20:14 +10:00
parent d67b826033
commit bfc914aaa9
5 changed files with 23 additions and 13 deletions

View File

@ -69,7 +69,7 @@ function(detect_architecture)
CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Building x86_64 binaries.")
set(CPU_ARCH_X64 TRUE PARENT_SCOPE)
if(NOT MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(NOT MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT DISABLE_SSE4)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1" PARENT_SCOPE)
endif()