mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Set -Werror / /WX via target_compile_options to force warnings as errors
This commit is contained in:
parent
3f70998896
commit
bbcc4b00fb
5 changed files with 35 additions and 8 deletions
|
@ -165,8 +165,18 @@ if (MSVC)
|
|||
|
||||
# Disable Spicy as it is not yet supported in Windows.
|
||||
set(DISABLE_SPICY true)
|
||||
|
||||
if (BUILD_WITH_WERROR)
|
||||
# TODO: This is disabled for now because there a bunch of known
|
||||
# compiler warnings on Windows that we don't have good fixes for.
|
||||
#set(WERROR_FLAG "/WX")
|
||||
#set(WERROR_FLAG "/WX")
|
||||
endif ()
|
||||
else ()
|
||||
include(GNUInstallDirs)
|
||||
if (BUILD_WITH_WERROR)
|
||||
set(WERROR_FLAG "-Werror")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(cmake/CommonCMakeConfig.cmake)
|
||||
|
@ -254,6 +264,7 @@ endif ()
|
|||
foreach (name zeek_exe zeek_lib zeek_fuzzer_shared)
|
||||
if (TARGET ${name})
|
||||
target_compile_definitions(${name} PRIVATE ZEEK_CONFIG_SKIP_VERSION_H)
|
||||
target_compile_options(${name} PRIVATE ${WERROR_FLAG})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
|
@ -347,6 +358,7 @@ function (zeek_add_subdir_library name)
|
|||
add_dependencies(${target_name} zeek_autogen_files)
|
||||
target_link_libraries(${target_name} PRIVATE $<BUILD_INTERFACE:zeek_internal>)
|
||||
add_clang_tidy_files(${FN_ARGS_SOURCES})
|
||||
target_compile_options(${target_name} PRIVATE ${WERROR_FLAG})
|
||||
|
||||
# Take care of compiling BIFs.
|
||||
if (FN_ARGS_BIFS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue