[build] Compress shared object debug info (#8835)

This saves a huge amount of space when they're unzipped for robot
projects, while not increasing artifact size.
This commit is contained in:
Gold856
2026-04-29 15:14:11 -04:00
committed by GitHub
parent 433c7f00ad
commit 668124e0fd
3 changed files with 3 additions and 1 deletions

View File

@@ -63,5 +63,6 @@ macro(wpilib_target_warnings target)
AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"
)
target_compile_options(${target} PRIVATE -gz=zlib)
target_link_options(${target} PRIVATE -gz=zlib)
endif()
endmacro()

View File

@@ -13,7 +13,7 @@ common:linux --repo_env=BAZEL_CXXOPTS="-std=c++23:-Wformat=2:-pedantic:-Wno-psab
common:linux --repo_env=BAZEL_CONLYOPTS="-Wformat=2:-pedantic:-Wno-psabi:-Wno-unused-parameter:-fPIC:-pthread"
# Linker
common:linux --repo_env=BAZEL_LINKOPTS="-rdynamic:-pthread:-ldl:-latomic:-Wl,-rpath,'$ORIGIN'"
common:linux --repo_env=BAZEL_LINKOPTS="-rdynamic:-pthread:-ldl:-latomic:-Wl,-rpath,'$ORIGIN':-gz=zlib"
# Cleanup build output for tools
build:linux --host_cxxopt=-Wno-missing-field-initializers

View File

@@ -46,6 +46,7 @@ nativeUtils.platformConfigs.each {
if (it.name.contains('linux')) {
// Compress debug info on Linux
it.cppCompiler.debugArgs.add("-gz=zlib")
it.linker.args.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