mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
Architecture 30 was removed with CUDA 11, so most of the CUDA tests fail with it. Remove setting the architecture and bump the minimum version to 3.18, so CMP0104 takes effect and we can rely on the default architecture, which is guaranteed to be compilable. Use of __ldg() in ProperLinkFlags was removed as it only affects performance and is available only on sm_35 and above. Testing the functionality of CUDA_ARCHITECTURES is already covered by CudaOnly.Architecture and CudaOnly.CompileFlags.
21 lines
713 B
CMake
21 lines
713 B
CMake
cmake_minimum_required(VERSION 3.18)
|
|
project (ObjectLibrary CUDA CXX)
|
|
#Goal for this example:
|
|
#
|
|
#Build C++ and CUDA object files and than use them to make an executable
|
|
#Make sure that CMake logic to handle object output when multiple files
|
|
#with the same name works
|
|
add_subdirectory(Conflicts)
|
|
|
|
add_library(CudaMixedObjectLib OBJECT static.cu static.cpp)
|
|
|
|
add_executable(CudaObjectLibrary
|
|
main.cpp
|
|
$<TARGET_OBJECTS:CudaMixedObjectLib>
|
|
$<TARGET_OBJECTS:CudaConflicts>)
|
|
|
|
if(APPLE)
|
|
# Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
|
|
set_property(TARGET CudaObjectLibrary PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
|
|
endif()
|