This commit is contained in:
Eidolon 2025-10-01 16:35:48 -05:00
parent 6aee524ace
commit 8744023a87

View file

@ -328,13 +328,23 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
endif()
# Enable SSE2 for IA-32.
check_cxx_compiler_flag("-msse2" has_sse2)
if(SRB2_SYSTEM_BITS EQUAL 32 AND has_sse2)
message(STATUS "Using sse2 for IA-32")
if(SRB2_SYSTEM_BITS EQUAL 32)
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|AppleClang)")
target_compile_options(SRB2SDL2 PRIVATE "-msse2")
check_cxx_compiler_flag("-msse2" has_sse2)
if(has_sse2)
message(STATUS "Using SSE2 on IA-32")
target_compile_options(SRB2SDL2 PRIVATE "-msse2")
else()
message(FATAL_ERROR "Needs -msse2 compiler support")
endif()
elseif(MSVC)
target_compile_options(SRB2SDL2 PRIVATE "/arch:SSE2")
check_cxx_compiler_flag("/arch:sse2" has_sse2)
if(has_sse2)
message(STATUS "Using SSE2 on IA-32")
target_compile_options(SRB2SDL2 PRIVATE "/arch:SSE2")
else()
message(FATAL_ERROR "Needs /arch:SSE2 compiler support")
endif()
endif()
endif()