diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f347d8266..5303341b0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -694,17 +694,6 @@ if ( NOT DISABLE_SPICY ) add_dependencies(plugin-Zeek-Spicy spicy) add_dependencies(spicyz spicy) - # Spicy JIT relies on the path of the current executable to figure out - # whether it is run from a build or an install tree. This assumption - # gets broken for e.g., `spicyz` when running from the build tree - # (probably fixable), and also when JIT'ing directly from a `zeek` - # invocation (much harder to fix). Instead we generate shell - # definitions to support running and using Spicy or spicy-plugin - # functionality in the build tree, including JIT'ing directly from - # Zeek. - configure_file(${CMAKE_SOURCE_DIR}/auxil/spicy/spicy-path.in ${CMAKE_BINARY_DIR}/spicy-path @ONLY) - configure_file(${CMAKE_SOURCE_DIR}/auxil/spicy/hilti-cxx-include-dirs.in ${CMAKE_BINARY_DIR}/hilti-cxx-include-dirs @ONLY) - # Also install spicy-plugin's CMake files into Zeek's global `cmake/` folder. # # NOTE: We do not install spicy-plugin's `FindZeek.cmake` since another @@ -715,6 +704,21 @@ if ( NOT DISABLE_SPICY ) endif () endif () +# Always generate helper scripts referenced in e.g., `zeek-path-dev.*` so the +# scripts work in any build configuration. If we do not include Spicy these +# files have no actual effect. +# +# Spicy JIT relies on the path of the current executable to figure out +# whether it is run from a build or an install tree. This assumption +# gets broken for e.g., `spicyz` when running from the build tree +# (probably fixable), and also when JIT'ing directly from a `zeek` +# invocation (much harder to fix). Instead we generate shell +# definitions to support running and using Spicy or spicy-plugin +# functionality in the build tree, including JIT'ing directly from +# Zeek. +configure_file(${CMAKE_SOURCE_DIR}/auxil/spicy/spicy-path.in ${CMAKE_BINARY_DIR}/spicy-path @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/auxil/spicy/hilti-cxx-include-dirs.in ${CMAKE_BINARY_DIR}/hilti-cxx-include-dirs @ONLY) + ######################################################################## ## Packaging Setup