CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC|_SHARED getting ignored or internally modified?
So I am trying to setup clang-cl/clang mixed toolchain to compile cuda code. Unfortunatly I am getting blocked by the error:
LINK : fatal error LNK1181: cannot open input file 'cudadevrt.obj'
I tried using/setting
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt.lib;cudart_static.lib")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt.lib;cudart.lib")
and even went as far as changing it in Modules/Compiler/Clang-CUDA.cmake to contain the .lib suffix but the error persist.
Either CMake is removing the .lib suffix somewhere or it gets the libraries from somewhere else since the --trace-expand logs do not show any further references for cudadevrt except for CMAKE_CUDA_(HOST_)?IMPLICIT_LINK_LIBRARIES_EXCLUDE
.
The libs seems to be added by <LINK_LIBRARIES>
in CMAKE_CUDA_CREATE_SHARED_LIBRARY
(cmake version 3.27.1)
Edited by Alexander Neumann