Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/timw/werror'
Browse files Browse the repository at this point in the history
* origin/topic/timw/werror:
  Pass -Werror in static plugin builds
  • Loading branch information
timwoj committed Jan 8, 2024
2 parents 507d120 + 8ce9cca commit 01fcb68
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ZeekPluginStatic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,20 @@ function (zeek_add_static_plugin ns name)
zeek_next_pac_block(at_end pacInputs pacRemainder ${pacRemainder})
endwhile ()

if (BUILD_WITH_WERROR)
if (MSVC)
# 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")
else ()
set(WERROR_FLAG "-Werror")
endif ()
endif ()

# Pass compiler flags, paths and dependencies to the target.
target_link_libraries(${target_name} PRIVATE $<BUILD_INTERFACE:zeek_internal>)
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_options(${target_name} PRIVATE ${WERROR_FLAG})

# Per convention, plugins have their headers and sources under src/ and
# legacy/external plugins expect this to auto-magically be available as
Expand Down

0 comments on commit 01fcb68

Please sign in to comment.