summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-04-05 19:28:54 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2021-04-05 21:41:10 (GMT)
commit764606e25616e9f47eceb3227a3b38fcef544820 (patch)
tree7a37b1499cf84a1da7fbae42f84c460f2c645eaf /Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
parent5d44d73bbeaf04412aa744354cca9de8376cdfed (diff)
downloadCMake-764606e25616e9f47eceb3227a3b38fcef544820.zip
CMake-764606e25616e9f47eceb3227a3b38fcef544820.tar.gz
CMake-764606e25616e9f47eceb3227a3b38fcef544820.tar.bz2
CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths
The NVHPC compiler does not have any implicit link directories that can be used to detect `CMAKE_LIBRARY_ARCHITECTURE`, but it does have implicit object files. Extract implicit object file paths from link lines and check them for the `CMAKE_LIBRARY_ARCHITECTURE` pattern. Issue: #22024
Diffstat (limited to 'Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake')
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index 87feda9..1f3468b 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -28,6 +28,7 @@ set(targets
linux-Fortran-PGI-18.10.1 linux_pgf77-Fortran-PGI-18.10.1
linux_nostdinc-C-PGI-18.10.1 linux_nostdinc-CXX-PGI-18.10.1
linux_nostdinc-Fortran-PGI-18.10.1
+ linux-C-NVHPC-21.1.0 linux-CXX-NVHPC-21.1.0
linux-C-XL-12.1.0 linux-CXX-XL-12.1.0 linux-Fortran-XL-14.1.0
linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
@@ -132,6 +133,7 @@ foreach(t ${targets})
# Need to handle files with empty entries for both libs or dirs
set(implicit_lib_output "")
set(idirs_output "")
+ set(implicit_objs "")
set(library_arch_output "")
file(STRINGS ${outfile} outputs)
foreach(line IN LISTS outputs)
@@ -147,10 +149,11 @@ foreach(t ${targets})
endforeach()
cmake_parse_implicit_link_info("${input}" implicit_libs idirs implicit_fwks log
- "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
+ "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}"
+ COMPUTE_IMPLICIT_OBJECTS implicit_objs)
set(library_arch)
- cmake_parse_library_architecture("${idirs}" library_arch)
+ cmake_parse_library_architecture(${lang} "${idirs}" "${implicit_objs}" library_arch)
# File format
# file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\nlibrary_arch=${library_arch}")