commit 694af5c: [Minor] Remove CXX linker requirement unless static Hyperscan is linked

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jul 9 11:07:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-09 12:05:33 +0100
URL: https://github.com/rspamd/rspamd/commit/694af5cd68843c8f9bf86e2e404c60d7048a91b6 (HEAD -> master)

[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)


More information about the Commits mailing list