]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Always enable sse2 on x86_64
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 27 Jun 2019 13:16:12 +0000 (14:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 27 Jun 2019 13:16:12 +0000 (14:16 +0100)
CMakeLists.txt

index b3fd7cae19c4297cf1f9369f55386635e0b0d6f7..80e00e67ec63fd05047a412de18015547fffe1b8 100644 (file)
@@ -74,6 +74,17 @@ IF (NOT "${ARCH}" STREQUAL "x86_64")
        SET(ENABLE_HYPERSCAN "OFF")
 ENDIF()
 
+IF ("${ARCH}" STREQUAL "x86_64")
+       MESSAGE(STATUS "Enable sse2 on x86_64 architecture")
+       IF((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
+               ADD_COMPILE_OPTIONS(-msse2)
+       ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Intel")
+               ADD_COMPILE_OPTIONS(/QxSSE2)
+       ELSEIF((CMAKE_C_COMPILER_ID MATCHES "MSVC"))
+               ADD_COMPILE_OPTIONS(/arch:SSE2)
+       ENDIF()
+ENDIF()
+
 IF(ENABLE_PCRE2 MATCHES "ON")
        SET(WITH_PCRE2 1)
        # For utf8 API