From 8a1e8bbfdf47102bb9f25cf58d4f171b54124b2c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 28 May 2016 12:26:49 +0100 Subject: [PATCH] [Feature] Allow static lua files in any parts of rspamd sources --- src/rspamadm/lua_preprocess.pl => lua_preprocess.pl | 0 src/CMakeLists.txt | 2 ++ src/lua/CMakeLists.txt | 7 +++++++ src/rspamadm/CMakeLists.txt | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) rename src/rspamadm/lua_preprocess.pl => lua_preprocess.pl (100%) diff --git a/src/rspamadm/lua_preprocess.pl b/lua_preprocess.pl similarity index 100% rename from src/rspamadm/lua_preprocess.pl rename to lua_preprocess.pl diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a7b03f55c..0c1e31dbe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -111,6 +111,8 @@ TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg) TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) +ADD_DEPENDENCIES(rspamd-server rspamd_lua_preprocess) + IF (ENABLE_CLANG_PLUGIN MATCHES "ON") ADD_DEPENDENCIES(rspamd-server rspamd-clang) ENDIF() diff --git a/src/lua/CMakeLists.txt b/src/lua/CMakeLists.txt index cb97ca3ed..544fbac3a 100644 --- a/src/lua/CMakeLists.txt +++ b/src/lua/CMakeLists.txt @@ -30,3 +30,10 @@ SET(LUASRC ${CMAKE_CURRENT_SOURCE_DIR}/lua_common.c ${CMAKE_CURRENT_SOURCE_DIR}/lua_map.c) SET(RSPAMD_LUA ${LUASRC} PARENT_SCOPE) +SET(RSPAMDMLUASRC "") +ADD_CUSTOM_TARGET(rspamd_lua_preprocess + ${PERL_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/lua_preprocess.pl" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + SOURCES ${RSPAMDMLUASRC} ${CMAKE_SOURCE_DIR}/lua_preprocess.pl) \ No newline at end of file diff --git a/src/rspamadm/CMakeLists.txt b/src/rspamadm/CMakeLists.txt index 65b8669bc..992e2a3aa 100644 --- a/src/rspamadm/CMakeLists.txt +++ b/src/rspamadm/CMakeLists.txt @@ -25,10 +25,10 @@ SET(RSPAMADMLUASRC INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_CUSTOM_TARGET(rspamadm_lua_preprocess ${PERL_EXECUTABLE} - "${CMAKE_CURRENT_SOURCE_DIR}/lua_preprocess.pl" + "${CMAKE_SOURCE_DIR}/lua_preprocess.pl" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" - SOURCES ${RSPAMADMLUASRC} ${CMAKE_CURRENT_SOURCE_DIR}/lua_preprocess.pl) + SOURCES ${RSPAMADMLUASRC} ${CMAKE_SOURCE_DIR}/lua_preprocess.pl) IF (ENABLE_HYPERSCAN MATCHES "ON") LIST(APPEND RSPAMADMSRC "${CMAKE_SOURCE_DIR}/src/hs_helper.c") ENDIF() -- 2.39.5