summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake')
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
new file mode 100644
index 0000000..1e0a2c9
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
@@ -0,0 +1,12 @@
+
+if (CMAKE_CXX_LINK_OPTIONS_PIE)
+ 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)
+ file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED TRUE)\n")
+else()
+ file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED FALSE)\n")
+endif()