Merge remote-tracking branch 'origin/topic/timw/force-std-c++-17'

* origin/topic/timw/force-std-c++-17:
  Force -std=c++17 mode for plugin targets, remove use of RequireCXX17.cmake
This commit is contained in:
Tim Wojtulewicz 2023-06-15 12:15:29 -07:00
commit 48af56c00b
7 changed files with 22 additions and 5 deletions

View file

@ -1,3 +1,9 @@
6.1.0-dev.80 | 2023-06-15 12:15:29 -0700
* Force -std=c++17 mode for plugin targets, remove use of RequireCXX17.cmake (Tim Wojtulewicz, Corelight)
* Add Spicy updates to NEWS for 6.0. (Robin Sommer, Corelight)
6.1.0-dev.76 | 2023-06-15 18:36:25 +0200
* plugin/Manager: Warn when plugin with the same name is found (Arne Welzel, Corelight)

View file

@ -188,7 +188,6 @@ add_library(zeek_internal INTERFACE)
add_library(Zeek::Internal ALIAS zeek_internal)
set_target_properties(zeek_internal PROPERTIES EXPORT_NAME Internal)
install(TARGETS zeek_internal EXPORT ZeekTargets)
target_compile_features(zeek_internal INTERFACE ${ZEEK_CXX_STD})
# Skip "link-time version check" in Plugin.h for plugins that we bake in.
target_compile_definitions(zeek_internal INTERFACE ZEEK_PLUGIN_SKIP_VERSION_CHECK)
@ -200,6 +199,8 @@ add_custom_target(zeek_autogen_files)
# reasons and backwards compatibility).
if (ZEEK_STANDALONE)
add_executable(zeek_exe)
target_compile_features(zeek_exe PRIVATE ${ZEEK_CXX_STD})
set_target_properties(zeek_exe PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(zeek_exe PRIVATE $<BUILD_INTERFACE:zeek_internal>)
add_dependencies(zeek_exe zeek_autogen_files)
set_target_properties(zeek_exe PROPERTIES RUNTIME_OUTPUT_NAME zeek)
@ -238,6 +239,8 @@ endif ()
# bundles all of our object libraries and other dependencies.
if (ZEEK_ENABLE_FUZZERS)
add_library(zeek_fuzzer_shared SHARED)
target_compile_features(zeek_fuzzer_shared PRIVATE ${ZEEK_CXX_STD})
set_target_properties(zeek_fuzzer_shared PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(zeek_fuzzer_shared PUBLIC $<BUILD_INTERFACE:zeek_internal>)
# Tell zeek_target_link_libraries to add library dependencies as PUBLIC.
set(zeek_fuzzer_shared_access PUBLIC)
@ -284,7 +287,6 @@ target_include_directories(
zeek_dynamic_plugin_base
INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
target_compile_features(zeek_dynamic_plugin_base INTERFACE ${ZEEK_CXX_STD})
add_library(Zeek::DynamicPluginBase ALIAS zeek_dynamic_plugin_base)
set_target_properties(zeek_dynamic_plugin_base PROPERTIES EXPORT_NAME DynamicPluginBase)
install(TARGETS zeek_dynamic_plugin_base EXPORT ZeekTargets)
@ -334,6 +336,8 @@ function (zeek_add_subdir_library name)
# Create target and add the sources.
set(target_name "zeek_${name}_obj")
add_library(${target_name} OBJECT ${FN_ARGS_SOURCES})
target_compile_features(${target_name} PRIVATE ${ZEEK_CXX_STD})
set_target_properties(${target_name} PROPERTIES CXX_EXTENSIONS OFF)
target_compile_definitions(${target_name} PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
add_dependencies(${target_name} zeek_autogen_files)
target_link_libraries(${target_name} PRIVATE $<BUILD_INTERFACE:zeek_internal>)
@ -1056,7 +1060,6 @@ include(PCAPTests)
include(OpenSSLTests)
include(CheckNameserCompat)
include(GetArchitecture)
include(RequireCXX17)
include(FindKqueue)
include(FindCAres)
include_directories(BEFORE "auxil/out_ptr/include")

View file

@ -1 +1 @@
6.1.0-dev.76
6.1.0-dev.80

2
cmake

@ -1 +1 @@
Subproject commit 4c3cd1146e9be6d7e04a5978336351b73f82a691
Subproject commit 0840965d6aaa5a90b1d0979c029d7ce9016fe827

View file

@ -510,6 +510,8 @@ set(zeek_SRCS
collect_headers(zeek_HEADERS ${zeek_SRCS})
add_library(zeek_objs OBJECT ${zeek_SRCS})
target_compile_features(zeek_objs PRIVATE ${ZEEK_CXX_STD})
set_target_properties(zeek_objs PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(zeek_objs PRIVATE $<BUILD_INTERFACE:zeek_internal>)
target_compile_definitions(zeek_objs PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
add_dependencies(zeek_objs zeek_autogen_files)

View file

@ -31,6 +31,8 @@ string(REGEX MATCH ".*\\.a$" _have_static_bind_lib "${BIND_LIBRARY}")
macro (SETUP_FUZZ_TARGET _fuzz_target _fuzz_source)
add_executable(${_fuzz_target} ${_fuzz_source} ${ARGN})
target_compile_features(${_fuzz_target} PRIVATE "${ZEEK_CXX_STD}")
set_target_properties(${_fuzz_target} PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(${_fuzz_target} zeek_fuzzer_shared)
if (_have_static_bind_lib)
@ -62,6 +64,8 @@ endmacro ()
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
add_library(zeek_fuzzer_standalone OBJECT standalone-driver.cc)
target_compile_features(zeek_fuzzer_standalone PRIVATE "${ZEEK_CXX_STD}")
set_target_properties(zeek_fuzzer_standalone PROPERTIES CXX_EXTENSIONS OFF)
target_sources(zeek_fuzzer_shared PRIVATE FuzzBuffer.cc)

View file

@ -5,6 +5,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/zeek/spic
add_executable(spicyz driver.cc glue-compiler.cc main.cc)
target_compile_options(spicyz PRIVATE "-Wall")
target_compile_features(spicyz PRIVATE "${ZEEK_CXX_STD}")
set_target_properties(spicyz PROPERTIES CXX_EXTENSIONS OFF)
target_include_directories(spicyz PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(spicyz PRIVATE hilti spicy)