blob: 93b35b8abfcbc69873671f688ce55b8558789d47 [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001macro(wpilib_target_warnings target)
2 if(NOT MSVC)
James Kuszmaulcf324122023-01-14 14:07:17 -08003 target_compile_options(${target} PRIVATE -Wall -pedantic -Wextra -Werror -Wno-unused-parameter ${WPILIB_TARGET_WARNINGS})
Brian Silverman8fce7482020-01-05 13:18:21 -08004 else()
James Kuszmaulcf324122023-01-14 14:07:17 -08005 target_compile_options(${target} PRIVATE /wd4146 /wd4244 /wd4251 /wd4267 /WX /D_CRT_SECURE_NO_WARNINGS ${WPILIB_TARGET_WARNINGS})
6 endif()
7
8 # Suppress C++-specific OpenCV warning; C compiler rejects it with an error
9 # https://github.com/opencv/opencv/issues/20269
10 if(UNIX AND NOT APPLE)
11 target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>)
12 elseif(UNIX AND APPLE)
13 target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-anon-enum-enum-conversion>)
Brian Silverman8fce7482020-01-05 13:18:21 -080014 endif()
15endmacro()