From bb57161594dc553e66035c46056b0b333e44a56d Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Wed, 3 Mar 2021 19:52:29 +0000 Subject: [PATCH] Use flags also during linking --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a9916bfba5..5c9f1b7aa68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,7 +216,9 @@ endif() # Compress the debug section for binaries if (COMPILER_GCC OR COMPILER_CLANG) - set(COMPILER_FLAGS "${COMPILER_FLAGS} -gz=zlib") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--compress-debug-sections=zlib") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--compress-debug-sections=zlib") + set (COMPILER_FLAGS "${COMPILER_FLAGS} -gz=zlib") endif () # Create BuildID when using lld. For other linkers it is created by default.