CUDA device link: need to handle '-Wl,' prefix
Starting with CMake
3.18, link options are propagated to device link step.
To enable a smooth transition from previous configuration for device link, CMake
automatically wrap options with some specific prefix (-Xcompiler
for NVidia CUDA
compiler, for example).
Unfortunately, this prefix is not compatible with options starting with the prefix -Wl
. In this case rather than prefixing the option with -Xcompiler
, it is required to transform the option by substituing -Wl
with -Xlinker=
.
For example, -Wl,-rpath,/usr/lib
must be transformed in -Xlinker=-rpath,/usr/lib