Merged requested to merge robertmaynard/cmake:correct_CMAKE_LIBRARY_ARCHITECTURE_regression into master
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
Fixes: #22024 (closed)