From 602b1f88fbc053752fff1cacd48788257ce71ab2 Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Wed, 27 Mar 2024 16:21:55 -0700 Subject: [PATCH] When configuring Spicy, be prepated for zeek_lib or zeek_exe targets. This avoids a configuration error where zeek_exe is not defined (i.e. when building (only) as a library). It anticipates building both the executable and the library, which we used to do when using Conan but currently don't. --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 665a5804f3..6452cd5bf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -962,8 +962,14 @@ if (NOT DISABLE_SPICY) hilti_link_object_libraries_in_tree(zeek_exe PRIVATE) spicy_link_object_libraries_in_tree(zeek_exe PRIVATE) else () - hilti_link_libraries_in_tree(zeek_exe PRIVATE) - spicy_link_libraries_in_tree(zeek_exe PRIVATE) + if (TARGET zeek_exe) + hilti_link_libraries_in_tree(zeek_exe PRIVATE) + spicy_link_libraries_in_tree(zeek_exe PRIVATE) + endif () + if (TARGET zeek_lib) + hilti_link_libraries_in_tree(zeek_lib PRIVATE) + spicy_link_libraries_in_tree(zeek_lib PRIVATE) + endif () endif () set(HAVE_SPICY yes)