From 9fc30265c877aac382d52a27fbebaaaf23c892d5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Oct 2021 12:57:29 +0200 Subject: [PATCH] cmake: Check for PIE support --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a05242485..d633396c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,12 @@ elseif(KEEPASSXC_DIST_TYPE STREQUAL "Other") unset(KEEPASSXC_DIST) endif() +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0") + cmake_policy(SET CMP0083 NEW) + include(CheckPIESupported) + check_pie_supported() +endif() + # Create position independent code for shared libraries and executables set(CMAKE_POSITION_INDEPENDENT_CODE ON)