diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-21 13:05:10 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-21 13:05:10 +0100 |
commit | ccc7ba9b428b20b1599346646e68a68c5bb2dc47 (patch) | |
tree | e426e972e898e408f6869b9bd0eb1ea67a367b76 /CMakeLists.txt | |
parent | c0646f71d680370e960bc52e45081fd65b60d782 (diff) | |
download | rspamd-ccc7ba9b428b20b1599346646e68a68c5bb2dc47.tar.gz rspamd-ccc7ba9b428b20b1599346646e68a68c5bb2dc47.zip |
More fixes to the static build
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) |