avoid enabling sse if not supported

This commit is contained in:
SimoneN64
2024-01-04 02:51:31 +01:00
parent d4d9aae321
commit 9fe8c3d87b

View File

@@ -45,7 +45,16 @@ if(WIN32)
add_definitions(-DNOMINMAX)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif ()
add_compile_options(-mssse3 -msse4.1)
include(CheckCCompilerFlag)
check_c_compiler_flag(-mssse3 HAS_SSSE3)
check_c_compiler_flag(-msse4.1 HAS_SSE4_1)
if (HAS_SSSE3 AND HAS_SSE4_1)
add_compile_options(-mssse3 -msse4.1)
endif ()
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
#add_compile_options(-fsanitize=address -fsanitize=undefined)
#add_link_options(-fsanitize=address -fsanitize=undefined)