1 #===-- runtime/CUDA/CMakeLists.txt -----------------------------------------===#
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 #===------------------------------------------------------------------------===#
9 include_directories(${CUDAToolkit_INCLUDE_DIRS})
11 # libCufRuntime depends on a certain version of CUDA. To be able to have
12 # multiple build of this library with different CUDA version, the version is
13 # added to the library name.
14 set(CUFRT_LIBNAME CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR})
16 add_flang_library(${CUFRT_LIBNAME}
25 if (BUILD_SHARED_LIBS)
26 set(CUDA_RT_TARGET CUDA::cudart)
28 set(CUDA_RT_TARGET CUDA::cudart_static)
31 target_link_libraries(${CUFRT_LIBNAME}