19 lines
762 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
add_executable(CudaOnlySeparateCompilation main.cu)
2023-05-23 16:38:00 +02:00
target_link_libraries(CudaOnlySeparateCompilation PRIVATE CUDASeparateLibB CUDASeparateLibC)
2021-09-14 00:13:48 +02:00
set_target_properties(CudaOnlySeparateCompilation PROPERTIES
CUDA_STANDARD 11
CUDA_STANDARD_REQUIRED TRUE
)
if(CMAKE_GENERATOR MATCHES "^Visual Studio")
# Visual Studio CUDA integration will not perform device linking
# on a target that itself does not have GenerateRelocatableDeviceCode
# enabled.
set_property(TARGET CudaOnlySeparateCompilation PROPERTY CUDA_SEPARABLE_COMPILATION ON)
endif()
if(APPLE)
# Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
set_property(TARGET CudaOnlySeparateCompilation PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()