From b47a5b367b7928f8926bc0915df9c009b2c5a248 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 2 Mar 2018 15:27:38 +0000 Subject: [PATCH] [Minor] Try to deal with linking hyperscan as a shared library --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97a085f33..490e42215 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) -- 2.39.5