[build] Build JNI and benchmarks as release by default (#8257)

It doesn't make sense to benchmark debug binaries. Also, wpimath JNI
performance in unit tests is drastically impacted by debug vs release.
This commit is contained in:
Tyler Veness
2025-09-29 17:47:17 -07:00
committed by GitHub
parent 0277759d44
commit bb5ee73e46
4 changed files with 21 additions and 4 deletions

View File

@@ -31,6 +31,9 @@ def main():
# Replace GCC warning argument with one Clang recognizes
elif arg == "-Wno-maybe-uninitialized":
out_args.append("-Wno-uninitialized")
# Skip GCC-specific warning argument
elif arg == "-Wno-error=restrict":
pass
else:
out_args.append(arg)

View File

@@ -181,7 +181,11 @@ tasks.register('deployStatic') {
model {
components {
benchmarkCpp(NativeExecutableSpec) {
targetBuildTypes 'debug'
if (project.hasProperty('ciDebugOnly')) {
targetBuildTypes 'debug'
} else {
targetBuildTypes 'release'
}
sources {
cpp {
source {
@@ -235,7 +239,11 @@ model {
}
}
benchmarkCppStatic(NativeExecutableSpec) {
targetBuildTypes 'debug'
if (project.hasProperty('ciDebugOnly')) {
targetBuildTypes 'debug'
} else {
targetBuildTypes 'release'
}
nativeUtils.excludeBinariesFromStrip(it)
sources {
cpp {

View File

@@ -39,12 +39,14 @@ nativeUtils.platformConfigs.each {
}
}
// Compress debug info on Linux
nativeUtils.platformConfigs.each {
if (it.name.contains('linux')) {
// Compress debug info on Linux
it.cppCompiler.debugArgs.add("-gz=zlib")
// Make warning in OpenCV 4.10 from GCC 15 not an error
it.cppCompiler.args.add("-Wno-error=overloaded-virtual")
// Make warning from Google Benchmark not an error
it.cppCompiler.args.add("-Wno-error=restrict")
}
}

View File

@@ -148,7 +148,11 @@ model {
// By default, a development executable will be generated. This is to help the case of
// testing specific functionality of the library.
"${nativeName}Dev"(NativeExecutableSpec) {
targetBuildTypes 'debug'
if (project.hasProperty('ciDebugOnly') || project.hasProperty('debugJNI')) {
targetBuildTypes 'debug'
} else {
targetBuildTypes 'release'
}
sources {
cpp {
source {