diff --git a/cmake/modules/CompileWarnings.cmake b/cmake/modules/CompileWarnings.cmake index 93b35b8abf..a869ccc0cf 100644 --- a/cmake/modules/CompileWarnings.cmake +++ b/cmake/modules/CompileWarnings.cmake @@ -12,4 +12,9 @@ macro(wpilib_target_warnings target) elseif(UNIX AND APPLE) target_compile_options(${target} PRIVATE $<$:-Wno-deprecated-anon-enum-enum-conversion>) endif() + + # Compress debug info with GCC + if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + target_compile_options(${target} PRIVATE -gz) + endif() endmacro() diff --git a/shared/config.gradle b/shared/config.gradle index a4efa986f2..5279f80ac0 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -43,6 +43,13 @@ nativeUtils.platformConfigs.each { } } +// Compress debug info on Linux +nativeUtils.platformConfigs.each { + if (it.name.contains('linux')) { + it.cppCompiler.debugArgs.add("-gz") + } +} + // NativeUtils adds the following OpenCV warning suppression for Linux, but not // for macOS // https://github.com/opencv/opencv/issues/20269