From 77bf71ea365a19ac55c59cf10399b566a02d82c1 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 6 Nov 2017 02:07:40 +0100 Subject: [PATCH] CMake: rename s/ENABLE_SSE2/CHECK_SSE2/. "ENABLE_SSE2" may be misleading since having it ON does not necessarily mean that SSE2 flags will be actually set. It only means that the support will be checked (then set only when supported). Also adding the warning about possible performance decrease. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61f5fdf..5d1ff0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ include(GNUInstallDirs) option(BUILD_BINARY "Build executable" ON) option(BUILD_SHARED_LIBS "Build shared library and link executable to it" ON) -option(ENABLE_SSE2 "Enable SSE2 extensions if the compiler supports it" ON) +option(CHECK_SSE2 "Check and enable SSE2 extensions if supported. Disabling SSE on platforms which support it may decrease performances." ON) if (BUILD_SHARED_LIBS) option(BUILD_STATIC "Build static library" ON) @@ -46,13 +46,13 @@ endif (BUILD_SHARED_LIBS) CHECK_C_COMPILER_FLAG(-msse2 SUPPORTS_CFLAG_SSE2) CHECK_C_COMPILER_FLAG(-mfpmath=sse SUPPORTS_CFLAG_SSE_MATH) -if (ENABLE_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) +if (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse") -else (ENABLE_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) +else (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffloat-store") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffloat-store") -endif (ENABLE_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) +endif (CHECK_SSE2 AND SUPPORTS_CFLAG_SSE2 AND SUPPORTS_CFLAG_SSE_MATH) configure_file( uchardet.pc.in