Revert putting plugins into a fresh scope for now

This commit is contained in:
Dominik Charousset 2023-04-25 17:20:33 +02:00
parent 1715028986
commit 9971121509

View file

@ -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}")