From 26a6bc7dfe75e49634758c5b0c2aa6ad0b306226 Mon Sep 17 00:00:00 2001 From: Benjamin Bannier Date: Wed, 9 Aug 2023 11:31:27 +0200 Subject: [PATCH] Explicitly link Zeek executable against Spicy libraries in binary packaging mode. Closes #3177. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ed58d3b99..950b183ae0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -943,6 +943,17 @@ if (NOT DISABLE_SPICY) include(ConfigureSpicyBuild) # set some options different for building Spicy zeek_add_dependencies(spicy) + + # Explicitly link against Spicy libraries if we are packaging. Since + # Zeek's binary packaging mode still leaves `BUILD_SHARED_LIBS` set we + # cannot use the branching inside `hilti_link_libraries_in_tree` and + # instead explicitly branch on `BINARY_PACKAGING_MODE` here. + if (BINARY_PACKAGING_MODE) + hilti_link_object_libraries_in_tree(zeek_exe PRIVATE) + else () + hilti_link_libraries_in_tree(zeek_exe PRIVATE) + endif () + set(HAVE_SPICY yes) endif ()