From 694af5cd68843c8f9bf86e2e404c60d7048a91b6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 9 Jul 2019 12:05:33 +0100 Subject: [PATCH] [Minor] Remove CXX linker requirement unless static Hyperscan is linked --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00c340553..06cc9fd30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,9 @@ ENDIF() SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}") -PROJECT(rspamd VERSION "${RSPAMD_VERSION}" LANGUAGES C CXX ASM) +PROJECT(rspamd VERSION "${RSPAMD_VERSION}" LANGUAGES C ASM) # This is supported merely with cmake 3.1 -SET(USE_CXX_LINKER 1) - SET(CMAKE_C_STANDARD 11) SET(CMAKE_C_STANDARD_REQUIRED ON) @@ -652,6 +650,14 @@ IF(ENABLE_HYPERSCAN MATCHES "ON") hs include/hs ROOT ${HYPERSCAN_ROOT_DIR} MODULES libhs) SET(WITH_HYPERSCAN 1) + + # For static linking with Hyperscan we need to link using CXX + IF (ENABLE_HYPERSCAN MATCHES "ON") + IF(${HYPERSCAN_LIBRARY} MATCHES ".*[.]a$" OR STATIC_HYPERSCAN) + ENABLE_LANGUAGE(CXX) + SET(USE_CXX_LINKER 1) + ENDIF() + ENDIF() ENDIF() #Check for openssl (required for dkim) -- 2.39.5