[libc++][Android] Allow testing libc++ with clang-r536225 (#116149)
[llvm-project.git] / flang / runtime / CUDA / CMakeLists.txt
blobce87f3efdc3632f96a89c665490ba872328b9aa7
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}
17   allocator.cpp
18   allocatable.cpp
19   descriptor.cpp
20   kernel.cpp
21   memory.cpp
22   registration.cpp
25 if (BUILD_SHARED_LIBS)
26   set(CUDA_RT_TARGET CUDA::cudart)
27 else()
28   set(CUDA_RT_TARGET CUDA::cudart_static)
29 endif()
31 target_link_libraries(${CUFRT_LIBNAME}
32   PRIVATE
33   FortranRuntime
34   ${CUDA_RT_TARGET}