diff --git a/ZeekPluginStatic.cmake b/ZeekPluginStatic.cmake index 44db57b..73fc9ac 100644 --- a/ZeekPluginStatic.cmake +++ b/ZeekPluginStatic.cmake @@ -52,10 +52,12 @@ function (zeek_add_static_plugin ns name) zeek_next_pac_block(at_end pacInputs pacRemainder ${pacRemainder}) endwhile () - if (MSVC) - #set(WERROR_FLAG "/WX") - else () - set(WERROR_FLAG "-Werror") + if (BUILD_WITH_WERROR) + if (MSVC) + #set(WERROR_FLAG "/WX") + else () + set(WERROR_FLAG "-Werror") + endif () endif () # Pass compiler flags, paths and dependencies to the target.