]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] fix static building 3915/head
authorDuncan Bellamy <dunk@denkimushi.com>
Mon, 27 Sep 2021 10:16:47 +0000 (11:16 +0100)
committerDuncan Bellamy <dunk@denkimushi.com>
Mon, 27 Sep 2021 10:18:19 +0000 (11:18 +0100)
cmake/Toolset.cmake
contrib/kann/CMakeLists.txt
contrib/libev/CMakeLists.txt
contrib/replxx/CMakeLists.txt

index 6ba290f96af73f97427ca258c968ca8cc50f9500..361456c9bcc766aebaa82ac922219c8d42dc5d93 100644 (file)
@@ -80,7 +80,7 @@ if (ENABLE_STATIC MATCHES "ON")
     SET(CMAKE_SKIP_INSTALL_RPATH ON)
     SET(BUILD_STATIC 1)
     SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-    SET(BUILD_SHARED_LIBRARIES OFF)
+    SET(BUILD_SHARED_LIBS OFF)
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
     SET(LINK_TYPE "STATIC")
     SET(NO_SHARED "ON")
index b3a1d547ccc790ced0668fedd653f13838945245..ba16d5e9f60f4cbd9918bce6d384b285c7202440 100644 (file)
@@ -1,6 +1,10 @@
 SET(LIBKANNSRC kautodiff.c kann.c)
 
-ADD_LIBRARY(rspamd-kann SHARED ${LIBKANNSRC})
+IF(ENABLE_STATIC MATCHES "ON")
+       ADD_LIBRARY(rspamd-kann STATIC ${LIBKANNSRC})
+ELSE()
+       ADD_LIBRARY(rspamd-kann SHARED ${LIBKANNSRC})
+ENDIF()
 
 IF(WITH_BLAS)
     MESSAGE(STATUS "Use openblas to accelerate kann")
index 53ab6c3623be74332a25a6680431dcc8d2179574..03d9df2545edd2906f3d8b2b6d5ee08097121563 100644 (file)
@@ -58,7 +58,11 @@ CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM)
 
 CONFIGURE_FILE(config.h.in libev-config.h)
 
-ADD_LIBRARY(rspamd-ev SHARED ${LIBEVSRC})
+IF(ENABLE_STATIC MATCHES "ON")
+       ADD_LIBRARY(rspamd-ev STATIC ${LIBEVSRC})
+ELSE()
+       ADD_LIBRARY(rspamd-ev SHARED ${LIBEVSRC})
+ENDIF()
 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
 ADD_DEFINITIONS("-DEV_CONFIG_H=\"libev-config.h\""
                -DEV_MULTIPLICITY=1
index da6e8d86511dd45db99dec569e6423910c339028..f48a0688d03a3904f7e0e083335f1fbfb06bc3fc 100644 (file)
@@ -64,7 +64,11 @@ set(
 )
 
 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
-add_library(rspamd-replxx SHARED ${REPLXX_SOURCES})
+if(ENABLE_STATIC MATCHES "ON")
+       add_library(rspamd-replxx STATIC ${REPLXX_SOURCES})
+else()
+       add_library(rspamd-replxx SHARED ${REPLXX_SOURCES})
+endif()
 
 target_include_directories(
        rspamd-replxx