commit d178f7e: [Minor] Add build system support for fasttext library

Vsevolod Stakhov vsevolod at rspamd.com
Sun Apr 23 19:56:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-04-23 20:53:39 +0100
URL: https://github.com/rspamd/rspamd/commit/d178f7e4c08c602e0c771ef75436556ccda3df09 (HEAD -> master)

[Minor] Add build system support for fasttext library

---
 CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5cb176c1..8ab5658d3 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(ENABLE_FASTTEXT     "Link with FastText library [default: OFF]"                  OFF)
 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)
@@ -242,6 +243,12 @@ ProcessPackage(SODIUM LIBRARY sodium INCLUDE sodium.h
 		INCLUDE_SUFFIXES include/libsodium include/sodium
 		ROOT ${LIBSODIUM_ROOT_DIR} MODULES libsodium>=1.0.0)
 
+if(ENABLE_FASTTEXT MATCHES "ON")
+	ProcessPackage(FASTTEXT LIBRARY fasttext INCLUDE fasttext.h
+			INCLUDE_SUFFIXES include/fasttext
+			ROOT ${FASTTEXT_ROOT_DIR} MODULES fasttext)
+endif()
+
 include (CompilerWarnings)
 include (Hyperscan)
 include (Openblas)


More information about the Commits mailing list