summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDuncan Bellamy <dunk@denkimushi.com>2021-05-23 12:57:58 +0100
committerDuncan Bellamy <dunk@denkimushi.com>2021-05-23 13:08:56 +0100
commit53034c0a7a245957d2f9a7663db625e69c6040ba (patch)
treef6cdc02e812e9acab5af9ff88c8ebdc7a7888f29 /CMakeLists.txt
parent4fe34b16f2f1d29359d93458ac5f8d9cf6ff38c3 (diff)
downloadrspamd-53034c0a7a245957d2f9a7663db625e69c6040ba.tar.gz
rspamd-53034c0a7a245957d2f9a7663db625e69c6040ba.zip
[Feature] add SYSTEM_ZSTD cmake option
To use the system zstd instead on the bundled version
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9706637e0..a0800ee0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,7 @@ OPTION(ENABLE_UTILS "Build rspamd internal utils [default: OFF]" OFF)
OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]" OFF)
OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF)
OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON)
+OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF)
############################# INCLUDE SECTION #############################################
@@ -625,7 +626,12 @@ ADD_SUBDIRECTORY(contrib/http-parser)
ADD_SUBDIRECTORY(contrib/fpconv)
ADD_SUBDIRECTORY(contrib/lc-btrie)
ADD_SUBDIRECTORY(contrib/libottery)
-ADD_SUBDIRECTORY(contrib/zstd)
+IF(SYSTEM_ZSTD MATCHES "OFF")
+ ADD_SUBDIRECTORY(contrib/zstd)
+ELSE()
+ ProcessPackage(LIBZSTD LIBRARY zstd INCLUDE zstd.h
+ ROOT ${LIBZSTD_ROOT_DIR} MODULES zstd)
+ENDIF()
IF(ENABLE_SNOWBALL MATCHES "ON")
ADD_SUBDIRECTORY(contrib/snowball)
SET(WITH_SNOWBALL 1)