Merge topic 'link-stubs-transitively'

2c6ec6de15 Link to transitive dependencies on stub libraries only on some linkers
dd4a6dff92 Link explicitly to private transitive dependencies on stub libraries
5f1bbdb3b3 Tests: Enable RunCMake.RuntimePath test on more platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9050
This commit is contained in:
Brad King
2024-01-08 14:47:05 +00:00
committed by Kitware Robot
12 changed files with 112 additions and 11 deletions

View File

@@ -1100,7 +1100,10 @@ if(CUDAToolkit_FOUND)
if(CUDA_${lib_name}_LIBRARY MATCHES "/stubs/" AND NOT WIN32)
# Use a SHARED library with IMPORTED_IMPLIB, but not IMPORTED_LOCATION,
# to indicate that the stub is for linkers but not dynamic loaders.
# It will not contribute any RPATH entry.
# It will not contribute any RPATH entry. When encountered as
# a private transitive dependency of another shared library,
# it will be passed explicitly to linkers so they can find it
# even when the runtime library file does not exist on disk.
set(CUDA_IMPORT_PROPERTY IMPORTED_IMPLIB)
set(CUDA_IMPORT_TYPE SHARED)
endif()