mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Force -std=c++17 mode for plugin targets, remove use of RequireCXX17.cmake
This commit is contained in:
parent
f3b306a2ec
commit
62382e6cb9
5 changed files with 15 additions and 4 deletions
|
@ -188,7 +188,6 @@ add_library(zeek_internal INTERFACE)
|
||||||
add_library(Zeek::Internal ALIAS zeek_internal)
|
add_library(Zeek::Internal ALIAS zeek_internal)
|
||||||
set_target_properties(zeek_internal PROPERTIES EXPORT_NAME Internal)
|
set_target_properties(zeek_internal PROPERTIES EXPORT_NAME Internal)
|
||||||
install(TARGETS zeek_internal EXPORT ZeekTargets)
|
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.
|
# 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)
|
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).
|
# reasons and backwards compatibility).
|
||||||
if (ZEEK_STANDALONE)
|
if (ZEEK_STANDALONE)
|
||||||
add_executable(zeek_exe)
|
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>)
|
target_link_libraries(zeek_exe PRIVATE $<BUILD_INTERFACE:zeek_internal>)
|
||||||
add_dependencies(zeek_exe zeek_autogen_files)
|
add_dependencies(zeek_exe zeek_autogen_files)
|
||||||
set_target_properties(zeek_exe PROPERTIES RUNTIME_OUTPUT_NAME zeek)
|
set_target_properties(zeek_exe PROPERTIES RUNTIME_OUTPUT_NAME zeek)
|
||||||
|
@ -238,6 +239,8 @@ endif ()
|
||||||
# bundles all of our object libraries and other dependencies.
|
# bundles all of our object libraries and other dependencies.
|
||||||
if (ZEEK_ENABLE_FUZZERS)
|
if (ZEEK_ENABLE_FUZZERS)
|
||||||
add_library(zeek_fuzzer_shared SHARED)
|
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>)
|
target_link_libraries(zeek_fuzzer_shared PUBLIC $<BUILD_INTERFACE:zeek_internal>)
|
||||||
# Tell zeek_target_link_libraries to add library dependencies as PUBLIC.
|
# Tell zeek_target_link_libraries to add library dependencies as PUBLIC.
|
||||||
set(zeek_fuzzer_shared_access PUBLIC)
|
set(zeek_fuzzer_shared_access PUBLIC)
|
||||||
|
@ -284,7 +287,6 @@ target_include_directories(
|
||||||
zeek_dynamic_plugin_base
|
zeek_dynamic_plugin_base
|
||||||
INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
$<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)
|
add_library(Zeek::DynamicPluginBase ALIAS zeek_dynamic_plugin_base)
|
||||||
set_target_properties(zeek_dynamic_plugin_base PROPERTIES EXPORT_NAME DynamicPluginBase)
|
set_target_properties(zeek_dynamic_plugin_base PROPERTIES EXPORT_NAME DynamicPluginBase)
|
||||||
install(TARGETS zeek_dynamic_plugin_base EXPORT ZeekTargets)
|
install(TARGETS zeek_dynamic_plugin_base EXPORT ZeekTargets)
|
||||||
|
@ -334,6 +336,8 @@ function (zeek_add_subdir_library name)
|
||||||
# Create target and add the sources.
|
# Create target and add the sources.
|
||||||
set(target_name "zeek_${name}_obj")
|
set(target_name "zeek_${name}_obj")
|
||||||
add_library(${target_name} OBJECT ${FN_ARGS_SOURCES})
|
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)
|
target_compile_definitions(${target_name} PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
|
||||||
add_dependencies(${target_name} zeek_autogen_files)
|
add_dependencies(${target_name} zeek_autogen_files)
|
||||||
target_link_libraries(${target_name} PRIVATE $<BUILD_INTERFACE:zeek_internal>)
|
target_link_libraries(${target_name} PRIVATE $<BUILD_INTERFACE:zeek_internal>)
|
||||||
|
@ -1056,7 +1060,6 @@ include(PCAPTests)
|
||||||
include(OpenSSLTests)
|
include(OpenSSLTests)
|
||||||
include(CheckNameserCompat)
|
include(CheckNameserCompat)
|
||||||
include(GetArchitecture)
|
include(GetArchitecture)
|
||||||
include(RequireCXX17)
|
|
||||||
include(FindKqueue)
|
include(FindKqueue)
|
||||||
include(FindCAres)
|
include(FindCAres)
|
||||||
include_directories(BEFORE "auxil/out_ptr/include")
|
include_directories(BEFORE "auxil/out_ptr/include")
|
||||||
|
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit 4c3cd1146e9be6d7e04a5978336351b73f82a691
|
Subproject commit 917c1705d341f6f257d21ccdfffdd5f9002c923b
|
|
@ -510,6 +510,8 @@ set(zeek_SRCS
|
||||||
collect_headers(zeek_HEADERS ${zeek_SRCS})
|
collect_headers(zeek_HEADERS ${zeek_SRCS})
|
||||||
|
|
||||||
add_library(zeek_objs OBJECT ${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_link_libraries(zeek_objs PRIVATE $<BUILD_INTERFACE:zeek_internal>)
|
||||||
target_compile_definitions(zeek_objs PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
|
target_compile_definitions(zeek_objs PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
|
||||||
add_dependencies(zeek_objs zeek_autogen_files)
|
add_dependencies(zeek_objs zeek_autogen_files)
|
||||||
|
|
|
@ -31,6 +31,8 @@ string(REGEX MATCH ".*\\.a$" _have_static_bind_lib "${BIND_LIBRARY}")
|
||||||
|
|
||||||
macro (SETUP_FUZZ_TARGET _fuzz_target _fuzz_source)
|
macro (SETUP_FUZZ_TARGET _fuzz_target _fuzz_source)
|
||||||
add_executable(${_fuzz_target} ${_fuzz_source} ${ARGN})
|
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)
|
target_link_libraries(${_fuzz_target} zeek_fuzzer_shared)
|
||||||
|
|
||||||
if (_have_static_bind_lib)
|
if (_have_static_bind_lib)
|
||||||
|
@ -62,6 +64,8 @@ endmacro ()
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_library(zeek_fuzzer_standalone OBJECT standalone-driver.cc)
|
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)
|
target_sources(zeek_fuzzer_shared PRIVATE FuzzBuffer.cc)
|
||||||
|
|
||||||
|
|
|
@ -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)
|
add_executable(spicyz driver.cc glue-compiler.cc main.cc)
|
||||||
target_compile_options(spicyz PRIVATE "-Wall")
|
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_include_directories(spicyz PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_link_libraries(spicyz PRIVATE hilti spicy)
|
target_link_libraries(spicyz PRIVATE hilti spicy)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue