summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-12-23 22:22:59 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-12-23 22:23:11 (GMT)
commitd480ede35b82c540e9d93b7bb4280014875f6444 (patch)
treead2a4fe6eb8525e9ff47e889727cebd1e7c4b9ba /Tests
parent170fcebf2e866ce5266067716025a57c7e7e6ec4 (diff)
parentf255280fd908e4ef1af5eba6230e81b74d339855 (diff)
downloadCMake-d480ede35b82c540e9d93b7bb4280014875f6444.zip
CMake-d480ede35b82c540e9d93b7bb4280014875f6444.tar.gz
CMake-d480ede35b82c540e9d93b7bb4280014875f6444.tar.bz2
Merge topic 'link-options'
f255280fd9 PIE link options: Update strategy to fix performance regression Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2739
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CMP0083.cmake2
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake10
-rw-r--r--Tests/RunCMake/PositionIndependentCode/PIE.cmake3
3 files changed, 13 insertions, 2 deletions
diff --git a/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake
index 9713ea4..749ac79 100644
--- a/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake
@@ -6,6 +6,8 @@ add_executable (cmp0083_ref main.cpp)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
cmake_policy(SET CMP0083 NEW)
+include(CheckPIESupported)
+check_pie_supported()
add_executable (cmp0083_new_pie main.cpp)
diff --git a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
index 1e0a2c9..61e1b6d 100644
--- a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
@@ -1,11 +1,17 @@
-if (CMAKE_CXX_LINK_OPTIONS_PIE)
+cmake_policy(SET CMP0083 NEW)
+
+include (CheckPIESupported)
+
+check_pie_supported()
+
+if (CMAKE_CXX_LINK_PIE_SUPPORTED)
file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED TRUE)\n")
else()
file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED FALSE)\n")
endif()
-if (CMAKE_CXX_LINK_OPTIONS_NO_PIE)
+if (CMAKE_CXX_LINK_NO_PIE_SUPPORTED)
file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED TRUE)\n")
else()
file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED FALSE)\n")
diff --git a/Tests/RunCMake/PositionIndependentCode/PIE.cmake b/Tests/RunCMake/PositionIndependentCode/PIE.cmake
index a9d579d..16ed89c 100644
--- a/Tests/RunCMake/PositionIndependentCode/PIE.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/PIE.cmake
@@ -1,6 +1,9 @@
cmake_policy(SET CMP0083 NEW)
+include(CheckPIESupported)
+check_pie_supported()
+
add_executable (pie_on main.cpp)
set_property(TARGET pie_on PROPERTY POSITION_INDEPENDENT_CODE ON)