From: Soren Stoutner Date: Sat, 17 Jun 2023 19:12:49 +0000 (-0700) Subject: Add PIE (Position Independent Executable) compiler flags. https://redmine.stoutner... X-Git-Tag: v0.5~12 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=5459c24d9234b0973a1f0709f35391c6ccfe0c6f;p=PrivacyBrowserPC.git Add PIE (Position Independent Executable) compiler flags. https://redmine.stoutner.com/issues/1021 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 62b0491..42b28dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,15 @@ include(ECMInstallIcons) include(ECMQtDeclareLoggingCategory) include(FeatureSummary) +# Include the Position Independent Executable checker. +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. +set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + # Load the Qt components. find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core