From 8744023a873a3718797a1987e837fe63f7b0c4c0 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Wed, 1 Oct 2025 16:35:48 -0500 Subject: [PATCH] annoying --- src/CMakeLists.txt | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 407d79383..7e82a01e2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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()