From 99711215092f38959accd76ace5f000794ea99bb Mon Sep 17 00:00:00 2001 From: Dominik Charousset Date: Tue, 25 Apr 2023 17:20:33 +0200 Subject: [PATCH] Revert putting plugins into a fresh scope for now --- src/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 408bc4a944..117eaf2684 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -202,7 +202,10 @@ file(WRITE ${PRELOAD_SCRIPT} "# Warning, this is an autogenerated file!\n") set(LOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__load__.zeek) file(WRITE ${LOAD_SCRIPT} "# Warning, this is an autogenerated file!\n") -function(add_extra_builtin_plugin plugin_dir) +# TODO: this really should be a function to make sure we have an isolated scope. +# However, for historic reasons, we're not doing that yet. Some plugin +# modify global state such as `zeekdeps`. +macro(add_extra_builtin_plugin plugin_dir) get_filename_component(plugin_name "${plugin_dir}" NAME) if(IS_DIRECTORY "${plugin_dir}/cmake") @@ -215,7 +218,10 @@ function(add_extra_builtin_plugin plugin_dir) set(ZEEK_BUILDING_EXTRA_PLUGINS ON) add_subdirectory(${plugin_dir} ${CMAKE_CURRENT_BINARY_DIR}/builtin-plugins/${plugin_name}) -endfunction() + + # TODO: drop once we turn this into a function. + set(ZEEK_BUILDING_EXTRA_PLUGINS OFF) +endmacro() foreach (plugin_dir ${BUILTIN_PLUGIN_LIST}) add_extra_builtin_plugin("${plugin_dir}")