summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ParseImplicitLinkInfo
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-02 14:11:13 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-03 12:12:58 (GMT)
commit1d7fddca8ea1f1ac243d824a3c61079c77be3a75 (patch)
tree582558784dbd1493ee1ffabf888a720147c335cc /Tests/RunCMake/ParseImplicitLinkInfo
parent629eb3926bcc802de53f9982cad2005b4bf8f4ed (diff)
downloadCMake-1d7fddca8ea1f1ac243d824a3c61079c77be3a75.zip
CMake-1d7fddca8ea1f1ac243d824a3c61079c77be3a75.tar.gz
CMake-1d7fddca8ea1f1ac243d824a3c61079c77be3a75.tar.bz2
CMakeParseImplicitLinkInfo: Honor GNU static runtime library flags
With flags like `-static-libstdc++` or `-static-libgfortran`, the GNU compiler driver adds `-Bstatic ... -Bdynamic` around its language runtime library. Convert the libraries in between these to absolute paths so that mixed-language linking honors the static runtime libraries.
Diffstat (limited to 'Tests/RunCMake/ParseImplicitLinkInfo')
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output2
3 files changed, 3 insertions, 3 deletions
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index 961a3f5..dcdc7f1 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -70,7 +70,7 @@ function(load_compiler_info infile lang_var outcmvars_var outstr_var)
string(REGEX REPLACE "\r?\n" ";" in_lines "${in}")
foreach(line IN LISTS in_lines)
# check for special CMAKE variable lines and parse them if found
- if("${line}" MATCHES "^CMAKE_([_A-Za-z0-9]+)=(.*)$")
+ if("${line}" MATCHES "^CMAKE_([_A-Za-z0-9+]+)=(.*)$")
if("${CMAKE_MATCH_1}" STREQUAL "LANG") # handle CMAKE_LANG here
set(lang "${CMAKE_MATCH_2}")
else()
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output
index ac85fc7..d38dfee 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output
@@ -1,3 +1,3 @@
-libs=stdc\+\+;m;gcc_s;gcc;c;gcc_s;gcc
+libs=/usr/lib/gcc/x86_64-linux-gnu/10/libstdc\+\+.a;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output
index 6a594d3..edeb20c 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output
@@ -1,3 +1,3 @@
-libs=gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
+libs=/usr/lib/gcc/x86_64-linux-gnu/10/libgfortran.a;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
library_arch=x86_64-linux-gnu