]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
cmake: PIE linux debug build
authorThomas Debesse <dev@illwieckz.net>
Sun, 28 Mar 2021 00:30:16 +0000 (01:30 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 28 Mar 2021 17:15:51 +0000 (19:15 +0200)
radiant/CMakeLists.txt

index 6c62139d66c6ea94bcab9e874facfec45733ac37..12ee1dfa8bd8c7a736328b21aaf4126dd1119888 100644 (file)
@@ -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()