diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 14:19:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 14:19:43 +0000 |
commit | c3928cf525609b7d8d0bb37091411a9b87c4ddec (patch) | |
tree | 689626ee6cd60e6396d69e30d58d537ae5cc2c57 /cmake/Hyperscan.cmake | |
parent | 8f03e5ef523da05a7080e8e5f2617af5162ccab4 (diff) | |
download | rspamd-c3928cf525609b7d8d0bb37091411a9b87c4ddec.tar.gz rspamd-c3928cf525609b7d8d0bb37091411a9b87c4ddec.zip |
[Rework] Further cmake system rework
Diffstat (limited to 'cmake/Hyperscan.cmake')
-rw-r--r-- | cmake/Hyperscan.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/Hyperscan.cmake b/cmake/Hyperscan.cmake new file mode 100644 index 000000000..3dd774511 --- /dev/null +++ b/cmake/Hyperscan.cmake @@ -0,0 +1,19 @@ +option (ENABLE_HYPERSCAN "Enable hyperscan for fast regexp processing [default: OFF]" OFF) + +if (ENABLE_HYPERSCAN MATCHES "ON") + if (NOT "${ARCH}" STREQUAL "x86_64") + MESSAGE(FATAL_ERROR "Hyperscan is supported only on x86_64 architecture") + endif () + ProcessPackage (HYPERSCAN LIBRARY hs INCLUDE hs.h INCLUDE_SUFFIXES + hs include/hs + ROOT ${HYPERSCAN_ROOT_DIR} MODULES libhs) + set (WITH_HYPERSCAN 1) + + # For static linking with Hyperscan we need to link using CXX + if (ENABLE_HYPERSCAN MATCHES "ON") + if (${HYPERSCAN_LIBRARY} MATCHES ".*[.]a$" OR STATIC_HYPERSCAN) + enable_language (CXX) + set (USE_CXX_LINKER 1) + endif () + endif () +endif ()
\ No newline at end of file |