mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Add missing compiler flags and fix warnings (#4889)
This makes the build fail on warnings. It caught two out-of-bounds reads and a deprecation warning.
This commit is contained in:
@@ -41,14 +41,16 @@ nativeUtils.platformConfigs.each {
|
||||
}
|
||||
}
|
||||
|
||||
// Suppress OpenCV warning
|
||||
// NativeUtils adds the following OpenCV warning suppression for Linux, but not
|
||||
// for macOS
|
||||
// https://github.com/opencv/opencv/issues/20269
|
||||
nativeUtils.platformConfigs.each {
|
||||
if (it.name == nativeUtils.wpi.platforms.linuxx64) {
|
||||
it.cppCompiler.args.add("-Wno-deprecated-enum-enum-conversion")
|
||||
} else if (it.name.contains('osx')) {
|
||||
it.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")
|
||||
}
|
||||
nativeUtils.platformConfigs.osxuniversal.cppCompiler.args.add("-Wno-deprecated-anon-enum-enum-conversion")
|
||||
|
||||
// NativeUtils uses the wrong compiler arguments for roboRIO targets, but it's
|
||||
// too late to fix NativeUtils for the 2023 season. This temporarily overwrites
|
||||
// the flags.
|
||||
nativeUtils.platformConfigs.named(nativeUtils.wpi.platforms.roborio).configure {
|
||||
cppCompiler.args.remove('-Wno-error=deprecated-declarations')
|
||||
}
|
||||
|
||||
nativeUtils.platformConfigs.linuxathena.linker.args.add("-Wl,--fatal-warnings")
|
||||
|
||||
Reference in New Issue
Block a user