]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Try to deal with linking hyperscan as a shared library
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Mar 2018 15:27:38 +0000 (15:27 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Mar 2018 15:28:07 +0000 (15:28 +0000)
CMakeLists.txt

index 97a085f336bca9b2a8eb3c3b276784d51615dbc7..490e42215013e634e100d715d00b2340c7c491b5 100644 (file)
@@ -73,12 +73,7 @@ IF(NOT RAGEL_FOUND)
        MESSAGE(FATAL_ERROR "Ragel is required to build rspamd")
 ENDIF()
 
-IF ("${ARCH}" STREQUAL "x86_64")
-       IF (ENABLE_HYPERSCAN MATCHES "ON" OR ENABLE_STATIC MATCHES "ON")
-               ENABLE_LANGUAGE(CXX)
-               SET(USE_CXX_LINKER 1)
-       ENDIF()
-ELSE()
+IF (NOT "${ARCH}" STREQUAL "x86_64")
        MESSAGE(STATUS "Hyperscan support is possible only for x86_64 architecture")
        SET(ENABLE_HYPERSCAN "OFF")
 ENDIF()
@@ -713,6 +708,13 @@ IF(ENABLE_GPERF_TOOLS MATCHES "ON")
        SET(WITH_GPERF_TOOLS 1)
 ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON")
 
+IF (ENABLE_HYPERSCAN MATCHES "ON")
+       IF(${HYPERSCAN_LIBRARY} MATCHES ".*[.]a$")
+               ENABLE_LANGUAGE(CXX)
+               SET(USE_CXX_LINKER 1)
+       ENDIF()
+ENDIF()
+
 # Process with warn flags
 SET(CMAKE_C_WARN_FLAGS "")
 CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL)