From 2512fd1e68e9252b4154a32aff61ee64d63e42f5 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Fri, 27 Jan 2023 17:16:57 +0100 Subject: [PATCH] Switch to shared Spicy libraries by default. This should work now. It affects only the toolchain libraries `libhilti`/`libspicy`. the runtime libraries `libhilti-rt` and `libspicy-rt` are always built static (but they are small). Zeek itself doesn't link against the toolchain anymore now anyways, but a number of the Spicy tools do. Note, we have an issue with Broker I believe: it looks like it always overrides BUILD_SHARED_LIBS to `OFF` Addresses #2675. --- auxil/spicy/CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/auxil/spicy/CMakeLists.txt b/auxil/spicy/CMakeLists.txt index bae7ed6be6..da753fa009 100644 --- a/auxil/spicy/CMakeLists.txt +++ b/auxil/spicy/CMakeLists.txt @@ -14,15 +14,10 @@ endif () get_filename_component(dir ${BISON_EXECUTABLE} DIRECTORY ABSOLUTE) set(BISON_ROOT ${dir}/..) -# We currently only support building against statically linked Spicy libraries. -# This is due to global state held in the Spicy and HILTI runtime libraries. If -# we would like Spicy dynamically this global state would end up the the final -# binary once via the static link of the runtime libraries into Zeek (needed to -# make sure we can e.g., load arbitrary HLTO files), and once as a link -# dependency of spicy-plugin. This can lead to e.g. consistency issues during -# execution or the problem during teardown where the same global might be -# cleaned up multiple times. -set(BUILD_SHARED_LIBS OFF) +if ( NOT BINARY_PACKAGING_MODE ) + # TODO: Broker seems to always turn on static libraries. We don't want that for Spicy by default. + set(BUILD_SHARED_LIBS yes) +endif () # Spicy uses slightly less strict warnings than Zeek proper. Mute a few warnings for Spicy. # NOTE: Compiler flags are inherited down the directory tree, so in order to