summaryrefslogtreecommitdiffstats
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2012-07-05 18:49:40 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2012-07-05 18:49:40 (GMT)
commitac7a1939511eda6b2baa1211fa5dcd12ec241fae (patch)
tree2c1b9ef610e94a12de61b19016cfeeee9169ef09 /Modules/GetPrerequisites.cmake
parent370c422def60c84dc54da9c92cacf9b6ff7522ac (diff)
downloadCMake-ac7a1939511eda6b2baa1211fa5dcd12ec241fae.zip
CMake-ac7a1939511eda6b2baa1211fa5dcd12ec241fae.tar.gz
CMake-ac7a1939511eda6b2baa1211fa5dcd12ec241fae.tar.bz2
GetPrerequisites.cmake: detect executables built with the -pie linker flag.
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r--Modules/GetPrerequisites.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 8761f40..d215685 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -195,6 +195,14 @@ function(is_file_executable file result_var)
return()
endif("${file_ov}" MATCHES "text")
endif("${file_ov}" MATCHES "executable")
+
+ # Also detect position independent executables on Linux,
+ # where "file" gives "shared object ... (uses shared libraries)"
+ if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)")
+ set(${result_var} 1 PARENT_SCOPE)
+ return()
+ endif()
+
else(file_cmd)
message(STATUS "warning: No 'file' command, skipping execute_process...")
endif(file_cmd)