mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[build] Suppress enum-enum deprecation warning in OpenCV (#4365)
This commit is contained in:
@@ -4,4 +4,12 @@ macro(wpilib_target_warnings target)
|
||||
else()
|
||||
target_compile_options(${target} PRIVATE /wd4146 /wd4244 /wd4251 /wd4267 /WX /D_CRT_SECURE_NO_WARNINGS ${WPILIB_TARGET_WARNINGS})
|
||||
endif()
|
||||
|
||||
# Suppress C++-specific OpenCV warning; C compiler rejects it with an error
|
||||
# https://github.com/opencv/opencv/issues/20269
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>)
|
||||
elseif(UNIX AND APPLE)
|
||||
target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-anon-enum-enum-conversion>)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -43,6 +43,16 @@ nativeUtils.platformConfigs.each {
|
||||
}
|
||||
}
|
||||
|
||||
// Suppress OpenCV warning
|
||||
// https://github.com/opencv/opencv/issues/20269
|
||||
nativeUtils.platformConfigs.each {
|
||||
if (it.name == 'linuxx86-64') {
|
||||
it.cppCompiler.args.add("-Wno-deprecated-enum-enum-conversion")
|
||||
} else if (it.name == 'osxx86-64' || it.name == 'osxarm64') {
|
||||
it.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")
|
||||
}
|
||||
}
|
||||
|
||||
nativeUtils.platformConfigs.linuxathena.linker.args.add("-Wl,--fatal-warnings")
|
||||
|
||||
model {
|
||||
|
||||
Reference in New Issue
Block a user