summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-12-21 14:41:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-12-21 14:41:02 (GMT)
commit3768a79c232dc2456b9e9b70da6582b0eb1e78f1 (patch)
treeeae25a23194e1836c26c9ef4cd4d05048b3a2e13
parentba88bfcf212bc8e93eb065e6d4bafbbf34394e68 (diff)
parent928d2085d8ebeadc498e9e9f884b8adabf3346c3 (diff)
downloadCMake-3768a79c232dc2456b9e9b70da6582b0eb1e78f1.zip
CMake-3768a79c232dc2456b9e9b70da6582b0eb1e78f1.tar.gz
CMake-3768a79c232dc2456b9e9b70da6582b0eb1e78f1.tar.bz2
Merge topic 'fix-absolute-libs-for-cray-wrappers'
928d2085 CrayPrgEnv: Don't use absolute paths for imlicit libraries
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake17
1 files changed, 11 insertions, 6 deletions
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index c3e7b73..61daa0f 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -4,12 +4,14 @@ if(__craylinux_crayprgenv)
endif()
set(__craylinux_crayprgenv 1)
-macro(__cray_extract_args cmd tag_regex out_var)
+macro(__cray_extract_args cmd tag_regex out_var make_absolute)
string(REGEX MATCHALL "${tag_regex}" args "${cmd}")
foreach(arg IN LISTS args)
string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}")
- get_filename_component(param_abs "${param}" ABSOLUTE)
- list(APPEND ${out_var} ${param_abs})
+ if(make_absolute)
+ get_filename_component(param "${param}" ABSOLUTE)
+ endif()
+ list(APPEND ${out_var} ${param})
endforeach()
endmacro()
@@ -21,15 +23,18 @@ function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
+ set(include_dirs)
+ set(link_dirs)
+ set(link_libs)
string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}")
foreach(line IN LISTS output_lines)
if("${line}" MATCHES "${compiler_cmd}")
- __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs)
+ __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1)
set(processed_include 1)
endif()
if("${line}" MATCHES "${link_cmd}")
- __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs)
- __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs)
+ __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1)
+ __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0)
set(processed_link 1)
endif()
if(processed_include AND processed_link)