diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9dbf7e9..29d309080 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,23 @@ ENDIF(NOT SYSTEMDDIR) SET(RSPAMD_DEFAULT_INCLUDE_PATHS "/opt;/usr;/usr/local;/opt/local;/usr/pkg;/opt/csw;/sw") SET(RSPAMD_DEFAULT_LIBRARY_PATHS "/usr/local;/usr/pkg;/usr;/Library/Frameworks;/sw;/opt/local;/opt/csw;/opt") +IF(ENABLE_STATIC MATCHES "ON") + MESSAGE(STATUS "Static build of rspamd implies that the target binary will be *GPL* licensed") + SET(GPL_RSPAMD_BINARY 1) + SET(BUILD_STATIC 1) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + SET(BUILD_SHARED_LIBRARIES OFF) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + SET(LINK_TYPE "STATIC") + SET(NO_SHARED "ON") +ELSE(ENABLE_STATIC MATCHES "ON") + IF (NO_SHARED MATCHES "OFF") + SET(LINK_TYPE "SHARED") + ELSE(NO_SHARED MATCHES "OFF") + SET(LINK_TYPE "STATIC") + ENDIF (NO_SHARED MATCHES "OFF") +ENDIF (ENABLE_STATIC MATCHES "ON") + ############################# INCLUDE SECTION ############################################# INCLUDE(CheckIncludeFiles) @@ -622,22 +639,6 @@ IF(ENABLE_GPERF_TOOLS MATCHES "ON") SET(WITH_GPERF_TOOLS 1) ENDIF(ENABLE_GPERF_TOOLS MATCHES "ON") -# Static build - -IF(ENABLE_STATIC MATCHES "ON") - SET(BUILD_STATIC 1) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -pthread") - MESSAGE(STATUS "Static build of rspamd, no custom plugins support") - SET(LINK_TYPE "STATIC") - SET(NO_SHARED "ON") -ELSE(ENABLE_STATIC MATCHES "ON") - IF(NO_SHARED MATCHES "OFF") - SET(LINK_TYPE "SHARED") - ELSE(NO_SHARED MATCHES "OFF") - SET(LINK_TYPE "STATIC") - ENDIF(NO_SHARED MATCHES "OFF") -ENDIF(ENABLE_STATIC MATCHES "ON") - # Process with warn flags SET(CMAKE_C_WARN_FLAGS "") CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) |