From fc24c3ffd228a4666b65556b3862d41c15ca04c3 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 28 Mar 2021 01:30:16 +0100 Subject: [PATCH] cmake: PIE linux debug build --- radiant/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 6c62139d..12ee1dfa 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -145,8 +145,11 @@ endif () # warning: allocated section `.dynstr' not in segment # and produce an unusable binary, better not strip when using this hack. # -# This hack is only wanted when NetRadiant is not installed system-wide. -if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT FHS_INSTALL) +# This hack is only wanted for release build and +# when NetRadiant is not installed system-wide. +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" + AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release" + AND NOT FHS_INSTALL) target_link_libraries(${RADIANT_BASENAME} -no-pie) endif() -- 2.39.2