[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / tools / nvptx-arch / CMakeLists.txt
blob1854d34ca075fe41ed940da9a96a57bbbe519d0e
1 # //===--------------------------------------------------------------------===//
2 # //
3 # // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # // See https://llvm.org/LICENSE.txt for details.
5 # // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 # //
7 # //===--------------------------------------------------------------------===//
9 set(LLVM_LINK_COMPONENTS Support)
10 add_clang_tool(nvptx-arch NVPTXArch.cpp)
12 find_package(CUDAToolkit QUIET)
14 # If we found the CUDA library directly we just dynamically link against it.
15 if(CUDAToolkit_FOUND AND NOT (LLVM_BUILD_32_BITS OR CMAKE_SIZEOF_VOID_P EQUAL 4))
16   target_link_libraries(nvptx-arch PRIVATE CUDA::cuda_driver)
17 else()
18   target_compile_definitions(nvptx-arch PRIVATE "DYNAMIC_CUDA")
19 endif()