diff --git a/cmake/modules/CompileWarnings.cmake b/cmake/modules/CompileWarnings.cmake index 54c7fce9f8..2d49ba9852 100644 --- a/cmake/modules/CompileWarnings.cmake +++ b/cmake/modules/CompileWarnings.cmake @@ -14,7 +14,9 @@ macro(wpilib_target_warnings target) endif() # Compress debug info with GCC - if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + if ((${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR + ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") AND + ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") target_compile_options(${target} PRIVATE -gz=zlib) endif() endmacro()