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