diff options
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Tests/CudaOnly/Fatbin/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CudaOnly/OptixIR/CMakeLists.txt | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7ca23a3..96a01ad 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3869,7 +3869,10 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions( void cmVisualStudio10TargetGenerator::WriteCudaLinkOptions( Elem& e1, std::string const& configName) { - if (this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) { + // We need to write link options for OBJECT libraries so that + // we override the default device link behavior ( enabled ) when + // building object libraries with ptx/optix-ir/etc + if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) { return; } diff --git a/Tests/CudaOnly/Fatbin/CMakeLists.txt b/Tests/CudaOnly/Fatbin/CMakeLists.txt index db0dc22..9974404 100644 --- a/Tests/CudaOnly/Fatbin/CMakeLists.txt +++ b/Tests/CudaOnly/Fatbin/CMakeLists.txt @@ -10,6 +10,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelB.cu ${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelC.cu) set_property(TARGET CudaFATBIN PROPERTY CUDA_FATBIN_COMPILATION ON) +set_property(TARGET CudaFATBIN PROPERTY CUDA_SEPARABLE_COMPILATION ON) # Will use `cuModuleLoadFatBinary` to load the fatbinaries add_executable(CudaOnlyFatbin main.cu) diff --git a/Tests/CudaOnly/OptixIR/CMakeLists.txt b/Tests/CudaOnly/OptixIR/CMakeLists.txt index afeabda..f408d40 100644 --- a/Tests/CudaOnly/OptixIR/CMakeLists.txt +++ b/Tests/CudaOnly/OptixIR/CMakeLists.txt @@ -13,6 +13,7 @@ if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.7.0") set_property(TARGET CudaOptix PROPERTY CUDA_OPTIX_COMPILATION ON) endif() +set_property(TARGET CudaOptix PROPERTY CUDA_SEPARABLE_COMPILATION ON) set_property(TARGET CudaOptix PROPERTY CUDA_ARCHITECTURES native) add_executable(CudaOnlyOptixIR main.cu) |