]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/CMakeLists.txt
Merge branch 'flake' into 'master'
[xonotic/netradiant.git] / radiant / CMakeLists.txt
index 93fedea428a461f615136ae3964c7d2e9e5f0238..12ee1dfa8bd8c7a736328b21aaf4126dd1119888 100644 (file)
@@ -36,7 +36,6 @@ set(RADIANTLIST
     filetypes.cpp filetypes.h
     filters.cpp filters.h
     findtexturedialog.cpp findtexturedialog.h
-    glwidget.cpp glwidget.h
     grid.cpp grid.h
     groupdialog.cpp groupdialog.h
     gtkdlgs.cpp gtkdlgs.h
@@ -132,4 +131,26 @@ if (X11_LIBRARIES)
     target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
 endif ()
 
+# PIE executables were wrongly recognized as shared libraries on Linux
+# because of a mistake in the mime-type library.
+# Because of that it was not possible to launch such executables from
+# the file browser.
+#
+# While the problem is fixed upstream, most distributions still ship
+# with a faulty mime-type library and may do for a long time.
+#
+# See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11
+#
+# It may produce such warning though at strip time:
+#   warning: allocated section `.dynstr' not in segment
+# and produce an unusable binary, better not strip when using this hack.
+#
+# 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()
+
 copy_dlls(${RADIANT_BASENAME})