From: Thomas Debesse Date: Sun, 28 Mar 2021 00:30:16 +0000 (+0100) Subject: cmake: PIE linux debug build X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fc24c3ffd228a4666b65556b3862d41c15ca04c3;p=xonotic%2Fnetradiant.git cmake: PIE linux debug build --- 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()