From: Vsevolod Stakhov Date: Thu, 14 Feb 2019 11:22:07 +0000 (+0000) Subject: [Minor] Try to fix linking hell X-Git-Tag: 1.9.0~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e550b8e7db3fef4ac94bc84f6ff9012643c9c272;p=rspamd.git [Minor] Try to fix linking hell --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e20c6f8d..19a796768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1225,12 +1225,6 @@ SET(WITH_HIREDIS 1) INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis") LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ucl) -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rdns) -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ottery) -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES event) -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES xxhash) -LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-actrie) IF(HAVE_FETCH_H) LIST(APPEND RSPAMD_REQUIRED_LIBRARIES fetch) ENDIF(HAVE_FETCH_H) @@ -1238,8 +1232,12 @@ IF(WITH_DB) LIST(APPEND RSPAMD_REQUIRED_LIBRARIES db) ENDIF(WITH_DB) - LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${LUA_LIBRARY}") +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ucl) +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rdns) +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES ottery) +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES event) +LIST(APPEND RSPAMD_REQUIRED_LIBRARIES xxhash) IF(GLIB_COMPAT) LIST(APPEND RSPAMD_REQUIRED_LIBRARIES glibadditions) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fc2560ce6..27b9277b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -212,6 +212,7 @@ IF(USE_CXX_LINKER) SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE CXX) ENDIF() + TARGET_LINK_LIBRARIES(rspamd-server ${RSPAMD_REQUIRED_LIBRARIES}) ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CMAKE_CURRENT_BINARY_DIR}/workers.c) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 0a92019d8..4e1225ae3 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -7,7 +7,6 @@ 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) -TARGET_LINK_LIBRARIES(rspamc ${RSPAMD_REQUIRED_LIBRARIES}) IF(USE_CXX_LINKER) SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX) ENDIF() diff --git a/src/rspamadm/CMakeLists.txt b/src/rspamadm/CMakeLists.txt index 8e3f09435..5be38aa28 100644 --- a/src/rspamadm/CMakeLists.txt +++ b/src/rspamadm/CMakeLists.txt @@ -25,7 +25,6 @@ IF (ENABLE_HYPERSCAN MATCHES "ON") ENDIF() ADD_EXECUTABLE(rspamadm ${RSPAMADMSRC}) TARGET_LINK_LIBRARIES(rspamadm rspamd-server) -TARGET_LINK_LIBRARIES(rspamadm ${RSPAMD_REQUIRED_LIBRARIES}) IF (NOT DEBIAN_BUILD) SET_TARGET_PROPERTIES(rspamadm PROPERTIES VERSION ${RSPAMD_VERSION}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ee6b074c3..101cf8588 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,11 +19,9 @@ ADD_EXECUTABLE(rspamd-test EXCLUDE_FROM_ALL ${TESTSRC}) SET_TARGET_PROPERTIES(rspamd-test PROPERTIES LINKER_LANGUAGE C) SET_TARGET_PROPERTIES(rspamd-test PROPERTIES COMPILE_FLAGS "-DRSPAMD_TEST") ADD_DEPENDENCIES(rspamd-test rspamd-server) -TARGET_LINK_LIBRARIES(rspamd-test ${RSPAMD_REQUIRED_LIBRARIES}) IF(USE_CXX_LINKER) SET_TARGET_PROPERTIES(rspamd-test PROPERTIES LINKER_LANGUAGE CXX) ENDIF() -TARGET_LINK_LIBRARIES(rspamd-test rspamd-actrie) TARGET_LINK_LIBRARIES(rspamd-test rspamd-server) IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")