mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +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
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit 6fd9b7405a2ee5c62e1a4d70ee47da8ca8bacb9a
|
Subproject commit 600bb015c0d5029c228a16bf052bd30c6af9ee10
|
|
@ -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)
|
set(LOAD_SCRIPT ${PROJECT_BINARY_DIR}/scripts/builtin-plugins/__load__.zeek)
|
||||||
file(WRITE ${LOAD_SCRIPT} "# Warning, this is an autogenerated file!\n")
|
file(WRITE ${LOAD_SCRIPT} "# Warning, this is an autogenerated file!\n")
|
||||||
|
|
||||||
foreach (plugin_dir ${BUILTIN_PLUGIN_LIST})
|
function(add_extra_builtin_plugin plugin_dir)
|
||||||
get_filename_component(plugin_name ${plugin_dir} NAME)
|
get_filename_component(plugin_name "${plugin_dir}" NAME)
|
||||||
|
|
||||||
if(IS_DIRECTORY "${plugin_dir}/cmake")
|
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()
|
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})
|
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()
|
endforeach()
|
||||||
|
|
||||||
install(FILES ${PRELOAD_SCRIPT} DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins/)
|
install(FILES ${PRELOAD_SCRIPT} DESTINATION ${ZEEK_SCRIPT_INSTALL_PATH}/builtin-plugins/)
|
||||||
|
|
|
@ -248,19 +248,10 @@
|
||||||
/* String with extension of dynamic libraries (e.g., ".so") */
|
/* String with extension of dynamic libraries (e.g., ".so") */
|
||||||
#define DYNAMIC_PLUGIN_SUFFIX "@CMAKE_SHARED_MODULE_SUFFIX@"
|
#define DYNAMIC_PLUGIN_SUFFIX "@CMAKE_SHARED_MODULE_SUFFIX@"
|
||||||
|
|
||||||
/* Set if we're building outside of the main Zeek source code tree. */
|
// For builtin plugins, we don't want to include zeek-version.h.
|
||||||
#ifndef ZEEK_PLUGIN_INTERNAL_BUILD
|
#ifndef ZEEK_CONFIG_SKIP_VERSION_H
|
||||||
#define ZEEK_PLUGIN_INTERNAL_BUILD true
|
|
||||||
#else
|
|
||||||
// Backwards compat for external plugins, include the version
|
|
||||||
// identifiers through zeek/zeek-version.h.
|
|
||||||
#if ! ZEEK_PLUGIN_INTERNAL_BUILD
|
|
||||||
#include "zeek/zeek-version.h"
|
#include "zeek/zeek-version.h"
|
||||||
#endif
|
#endif
|
||||||
//
|
|
||||||
// Not sure we can ever deprecate this without changing
|
|
||||||
// the names.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// GCC uses __SANITIZE_ADDRESS__, Clang uses __has_feature
|
// GCC uses __SANITIZE_ADDRESS__, Clang uses __has_feature
|
||||||
#if defined(__SANITIZE_ADDRESS__)
|
#if defined(__SANITIZE_ADDRESS__)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue