CUDA_RESOLVE_DEVICE_SYMBOLS not working if a .cpp file put into a static library along with .cu files
I started with ResolveDeviceSymbols test from CMake distribution, and modified it slightly, so that a .cpp file is added into a static library - the archive is attached. Now, the CUDA symbols won't get resolved when static library linked, but only when executable linked with static library, here is the make output:
Scanning dependencies of target CUDAResolveDeviceLib
[ 12%] Building CUDA object CMakeFiles/CUDAResolveDeviceLib.dir/file1.cu.o
[ 25%] Building CUDA object CMakeFiles/CUDAResolveDeviceLib.dir/file2.cu.o
[ 37%] Building CXX object CMakeFiles/CUDAResolveDeviceLib.dir/hello.cpp.o
[ 50%] Linking CUDA device code CMakeFiles/CUDAResolveDeviceLib.dir/cmake_device_link.o
[ 62%] Linking CXX static library libCUDAResolveDeviceLib.a
[ 62%] Built target CUDAResolveDeviceLib Scanning dependencies of target CudaOnlyResolveDeviceSymbols
[ 75%] Building CUDA object CMakeFiles/CudaOnlyResolveDeviceSymbols.dir/main.cu.o
[ 87%] Linking CUDA device code CMakeFiles/CudaOnlyResolveDeviceSymbols.dir/cmake_device_link.o
[100%] Linking CXX executable CudaOnlyResolveDeviceSymbols
[100%] Built target CudaOnlyResolveDeviceSymbols
My CMake version is 3.10.0.