]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Add PIE (Position Independent Executable) compiler flags. https://redmine.stoutner...
authorSoren Stoutner <soren@stoutner.com>
Sat, 17 Jun 2023 19:12:49 +0000 (12:12 -0700)
committerSoren Stoutner <soren@stoutner.com>
Sat, 17 Jun 2023 19:12:49 +0000 (12:12 -0700)
CMakeLists.txt

index 62b04912a069efc299dbebfdbd7b25039c634e85..42b28dd527ca4dd9ae1208fe41b3e56abfdbbdc5 100644 (file)
@@ -42,6 +42,15 @@ include(ECMInstallIcons)
 include(ECMQtDeclareLoggingCategory)
 include(FeatureSummary)
 
+# Include the Position Independent Executable checker.  <https://cmake.org/cmake/help/latest/policy/CMP0083.html>
+include(CheckPIESupported)
+
+# Check to see if Position Independent Executable is supported in the current linker and environment.
+check_pie_supported()
+
+# Add the Position Independent Executable compiler flag if it is supported in the current linker and environment.  <https://cmake.org/cmake/help/latest/variable/CMAKE_POSITION_INDEPENDENT_CODE.html>
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
 # Load the Qt components.
 find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
     Core