diff options
author | Petr Vaněk <arkamar@atlas.cz> | 2022-04-06 13:46:11 +0200 |
---|---|---|
committer | Petr Vaněk <arkamar@atlas.cz> | 2022-04-06 22:38:30 +0200 |
commit | baa1b3c57469413607a4b3745d4fe32b5506111a (patch) | |
tree | 4b2de0b28e274d0885f90c2ff5b87eb25c9e01c4 /CMakeLists.txt | |
parent | f24d59a607066d339597a1a537f3171c9350a1d6 (diff) | |
download | rspamd-baa1b3c57469413607a4b3745d4fe32b5506111a.tar.gz rspamd-baa1b3c57469413607a4b3745d4fe32b5506111a.zip |
Add SYSTEM_XXHASH cmake option
It is now possible to use system xxhash since commits 23889da9ae11
("[Minor] Update bundled xxhash") and 7ad02fc1f7e7 ("[Rework] Use xxh3
as a default hash and fix memory/alignment issues"). Let's give
packagers this possibility with a new SYSTEM_XXHASH option.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cff0bc231..d6f5df3c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [default: OFF]" OFF) OPTION(SYSTEM_DOCTEST "Use system doctest instead of bundled one [default: OFF]" OFF) +OPTION(SYSTEM_XXHASH "Use system xxhash instead of bundled one [default: OFF]" OFF) ############################# INCLUDE SECTION ############################################# @@ -111,7 +112,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" "${CMAKE_SOURCE_DIR}/contrib/http-parser" "${CMAKE_SOURCE_DIR}/contrib/fpconv" "${CMAKE_SOURCE_DIR}/contrib/libottery" - "${CMAKE_SOURCE_DIR}/contrib/xxhash" "${CMAKE_SOURCE_DIR}/contrib/cdb" "${CMAKE_SOURCE_DIR}/contrib/snowball/include" "${CMAKE_SOURCE_DIR}/contrib/librdns" @@ -581,7 +581,13 @@ IF(GLIB_COMPAT) ENDIF(GLIB_COMPAT) -ADD_SUBDIRECTORY(contrib/xxhash) +IF(SYSTEM_XXHASH MATCHES "OFF") + ADD_SUBDIRECTORY(contrib/xxhash) + INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/xxhash") +ELSE() + ProcessPackage(XXHASH LIBRARY xxhash INCLUDE xxhash.h + ROOT ${LIBXXHASH_ROOT_DIR} MODULES xxhash libxxhash) +ENDIF() ADD_SUBDIRECTORY(contrib/cdb) ADD_SUBDIRECTORY(contrib/http-parser) ADD_SUBDIRECTORY(contrib/fpconv) |