mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
Propagate zeek-version.h skip via CMake properties
Add a define for `ZEEK_CONFIG_SKIP_VERSION_H` to static plugins as well as to dynamic plugins that we build alongside Zeek. When including `zeek-config.h` with this macro defined, the header skips including `zeek-version.h`.
This commit is contained in:
parent
3f0eee5d9d
commit
1715028986
3 changed files with 15 additions and 15 deletions
|
@ -202,14 +202,23 @@ 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")
|
||||
|
||||
foreach (plugin_dir ${BUILTIN_PLUGIN_LIST})
|
||||
get_filename_component(plugin_name ${plugin_dir} NAME)
|
||||
function(add_extra_builtin_plugin plugin_dir)
|
||||
get_filename_component(plugin_name "${plugin_dir}" NAME)
|
||||
|
||||
if(IS_DIRECTORY "${plugin_dir}/cmake")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${plugin_dir}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${plugin_dir}/cmake")
|
||||
endif()
|
||||
|
||||
# Set this flag so that ZeekPluginStatic.cmake knows that this plugin is not
|
||||
# from our source tree but from an external source (or git submodule). This
|
||||
# will tell CMake to *not* define ZEEK_CONFIG_SKIP_VERSION_H for the plugin.
|
||||
set(ZEEK_BUILDING_EXTRA_PLUGINS ON)
|
||||
|
||||
add_subdirectory(${plugin_dir} ${CMAKE_CURRENT_BINARY_DIR}/builtin-plugins/${plugin_name})
|
||||
endfunction()
|
||||
|
||||
foreach (plugin_dir ${BUILTIN_PLUGIN_LIST})
|
||||
add_extra_builtin_plugin("${plugin_dir}")
|
||||
endforeach()
|
||||
|
||||
install(FILES ${PRELOAD_SCRIPT} DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins/)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue