commit ab88829: [Minor] Always use c++ linker now

Vsevolod Stakhov vsevolod at highsecure.ru
Fri May 28 10:56:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-28 11:52:49 +0100
URL: https://github.com/rspamd/rspamd/commit/ab8882972d32c737afeda1902f96879f75f0a512 (HEAD -> master)

[Minor] Always use c++ linker now

---
 cmake/Hyperscan.cmake       | 1 -
 src/CMakeLists.txt          | 8 ++------
 src/client/CMakeLists.txt   | 4 +---
 src/rspamadm/CMakeLists.txt | 5 +----
 test/CMakeLists.txt         | 4 +---
 utils/CMakeLists.txt        | 6 +-----
 6 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/cmake/Hyperscan.cmake b/cmake/Hyperscan.cmake
index 664ce7312..6bc3e6d11 100644
--- a/cmake/Hyperscan.cmake
+++ b/cmake/Hyperscan.cmake
@@ -10,7 +10,6 @@ if (ENABLE_HYPERSCAN MATCHES "ON")
     if (ENABLE_HYPERSCAN MATCHES "ON")
         if (${HYPERSCAN_LIBRARY} MATCHES ".*[.]a$" OR STATIC_HYPERSCAN)
             enable_language (CXX)
-            set (USE_CXX_LINKER 1)
         endif ()
     endif ()
 endif ()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 903aa3159..77c8756af 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -230,12 +230,8 @@ ENDIF()
 TARGET_LINK_LIBRARIES(rspamd-server ${RSPAMD_REQUIRED_LIBRARIES})
 
 ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CMAKE_CURRENT_BINARY_DIR}/workers.c)
-SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE C)
-SET_TARGET_PROPERTIES(rspamd PROPERTIES COMPILE_FLAGS "-DRSPAMD_MAIN")
-IF(USE_CXX_LINKER)
-	SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
-	SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE CXX)
-ENDIF()
+SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
+SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE CXX)
 IF(NOT DEBIAN_BUILD)
 	SET_TARGET_PROPERTIES(rspamd PROPERTIES VERSION ${RSPAMD_VERSION})
 ENDIF(NOT DEBIAN_BUILD)
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 4e1225ae3..60e422dbd 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -7,9 +7,7 @@ SET(RSPAMCSRC			  rspamc.c)
 ADD_EXECUTABLE(rspamc ${RSPAMCSRC} ${LIBRSPAMDCLIENTSRC})
 SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib")
 TARGET_LINK_LIBRARIES(rspamc rspamd-server)
-IF(USE_CXX_LINKER)
-	SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX)
-ENDIF()
+SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX)
 
 IF(NOT DEBIAN_BUILD)
 	SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
diff --git a/src/rspamadm/CMakeLists.txt b/src/rspamadm/CMakeLists.txt
index 51ce1bc1b..13e2fb6da 100644
--- a/src/rspamadm/CMakeLists.txt
+++ b/src/rspamadm/CMakeLists.txt
@@ -27,8 +27,5 @@ IF (NOT DEBIAN_BUILD)
     SET_TARGET_PROPERTIES(rspamadm PROPERTIES VERSION ${RSPAMD_VERSION})
 ENDIF (NOT DEBIAN_BUILD)
 
-IF(USE_CXX_LINKER)
-    SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
-ENDIF()
-
+SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
 INSTALL(TARGETS rspamadm RUNTIME DESTINATION bin)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 934b141c7..9e56cbad7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -16,9 +16,7 @@ SET(TESTSRC		rspamd_mem_pool_test.c
 ADD_EXECUTABLE(rspamd-test EXCLUDE_FROM_ALL ${TESTSRC})
 SET_TARGET_PROPERTIES(rspamd-test PROPERTIES COMPILE_FLAGS "-DRSPAMD_TEST")
 ADD_DEPENDENCIES(rspamd-test rspamd-server)
-IF(USE_CXX_LINKER)
-	SET_TARGET_PROPERTIES(rspamd-test PROPERTIES LINKER_LANGUAGE CXX)
-ENDIF()
+SET_TARGET_PROPERTIES(rspamd-test PROPERTIES LINKER_LANGUAGE CXX)
 TARGET_LINK_LIBRARIES(rspamd-test rspamd-server)
 
 SET(CXXTESTSSRC		rspamd_cxx_unit.cxx)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 8cc5978e0..5322dd37c 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -7,11 +7,7 @@ SET(MIMESRC mime_tool.c)
 
 MACRO(ADD_UTIL NAME)
 	ADD_EXECUTABLE("${NAME}" "${ARGN}")
-	IF (USE_CXX_LINKER)
-		SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE CXX)
-	ELSE()
-		SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE C)
-	ENDIF()
+	SET_TARGET_PROPERTIES("${NAME}" PROPERTIES LINKER_LANGUAGE CXX)
 	TARGET_LINK_LIBRARIES("${NAME}" rspamd-server)
 	IF (ENABLE_SNOWBALL MATCHES "ON")
 	TARGET_LINK_LIBRARIES("${NAME}" stemmer)


More information about the Commits mailing list