Skip to content

CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths

The change in !5773 (merged) caused CMAKE_LIBRARY_ARCHITECTURE to be populated on non-multiarch platforms if their compilers happen to use $arch/$version library directories. Revert the use of versioned library paths. Use another solution for NVHPC.

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.

Fixes: #22024 (closed)
Backport: release
Topic-rename: nvhpc-lib-arch

Edited by Brad King

Merge request reports