[CMAKE] Disable compression of debug sections in GCC <= 7.0

We use MSVC, Clang or GCC > 7.0 these days.
This commit is contained in:
Hervé Poussineau 2020-12-01 18:41:59 +01:00
parent 3014417919
commit 4469ab3620

View file

@ -241,13 +241,6 @@ set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--enable-auto-image-base,--disable-aut
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup")
if((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND
(NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND
(NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0))
# FIXME: Set this once Clang toolchain works with it
set(_compress_debug_sections_flag "-Wa,--compress-debug-sections")
endif()
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${_compress_debug_sections_flag} <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
# FIXME: Once the GCC toolchain bugs are fixed, add _compress_debug_sections_flag to CXX too
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")