Skip to content

Commit

Permalink
[build] CMake: Make NO_WERROR also work on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Dec 27, 2024
1 parent 0470e51 commit 15e47c3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions cmake/modules/CompileWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ macro(wpilib_target_warnings target)

target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
else()
target_compile_options(
${target}
PRIVATE
/wd4146
/wd4244
/wd4251
/wd4267
/wd4324
/WX
/D_CRT_SECURE_NO_WARNINGS
${WPILIB_TARGET_WARNINGS}
set(WARNING_FLAGS
/wd4146
/wd4244
/wd4251
/wd4267
/wd4324
/D_CRT_SECURE_NO_WARNINGS
${WPILIB_TARGET_WARNINGS}
)
if(NOT NO_WERROR)
set(WARNING_FLAGS ${WARNING_FLAGS} /WX)
endif()

target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
endif()

# Suppress C++-specific OpenCV warning; C compiler rejects it with an error
Expand Down

0 comments on commit 15e47c3

Please sign in to comment.