CMake: Add option to compress debug sections using -gz if possible

pull/491/head
Jonathan G Rennison 1 year ago
parent 5efe3a8b5b
commit c1532107fc

@ -170,6 +170,17 @@ macro(compile_flags)
endif()
endif()
if(OPTION_COMPRESS_DEBUG)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-gz" GZ_FOUND)
if(GZ_FOUND)
# Compress debug sections.
add_compile_options(-gz)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -gz")
endif()
endif(OPTION_COMPRESS_DEBUG)
if (OPTION_NO_WARN_UNINIT)
add_compile_options(-Wno-maybe-uninitialized -Wno-uninitialized)
endif (OPTION_NO_WARN_UNINIT)

Loading…
Cancel
Save