diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-04-05 19:28:54 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-04-05 21:41:10 (GMT) |
commit | 764606e25616e9f47eceb3227a3b38fcef544820 (patch) | |
tree | 7a37b1499cf84a1da7fbae42f84c460f2c645eaf /Modules/CMakeDetermineCompilerABI.cmake | |
parent | 5d44d73bbeaf04412aa744354cca9de8376cdfed (diff) | |
download | CMake-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 'Modules/CMakeDetermineCompilerABI.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index cf028f1..8191d81 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -135,11 +135,13 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # Parse implicit linker information for this language, if available. set(implicit_dirs "") + set(implicit_objs "") set(implicit_libs "") set(implicit_fwks "") if(CMAKE_${lang}_VERBOSE_FLAG) CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs implicit_fwks log - "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}") + "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}" + COMPUTE_IMPLICIT_OBJECTS implicit_objs) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Parsed ${lang} implicit link information from above output:\n${log}\n\n") endif() @@ -176,7 +178,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE) set(CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${implicit_fwks}" PARENT_SCOPE) - cmake_parse_library_architecture("${implicit_dirs}" architecture_flag) + cmake_parse_library_architecture(${lang} "${implicit_dirs}" "${implicit_objs}" architecture_flag) if(architecture_flag) set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${architecture_flag}" PARENT_SCOPE) endif() |