mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
Merge branch 'backport-3.15-cuda-device-link-only-cuda'
This commit is contained in:
@@ -183,29 +183,29 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
|
||||
return cmIsOn(resolveDeviceSymbols);
|
||||
}
|
||||
|
||||
if (const char* separableCompilation =
|
||||
target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
|
||||
if (cmIsOn(separableCompilation)) {
|
||||
bool doDeviceLinking = false;
|
||||
switch (target.GetType()) {
|
||||
case cmStateEnums::SHARED_LIBRARY:
|
||||
case cmStateEnums::MODULE_LIBRARY:
|
||||
case cmStateEnums::EXECUTABLE:
|
||||
doDeviceLinking = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return doDeviceLinking;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if we have any dependencies that require
|
||||
// us to do a device link step
|
||||
cmGeneratorTarget::LinkClosure const* closure =
|
||||
target.GetLinkClosure(config);
|
||||
|
||||
if (cmContains(closure->Languages, "CUDA")) {
|
||||
if (const char* separableCompilation =
|
||||
target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
|
||||
if (cmIsOn(separableCompilation)) {
|
||||
bool doDeviceLinking = false;
|
||||
switch (target.GetType()) {
|
||||
case cmStateEnums::SHARED_LIBRARY:
|
||||
case cmStateEnums::MODULE_LIBRARY:
|
||||
case cmStateEnums::EXECUTABLE:
|
||||
doDeviceLinking = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return doDeviceLinking;
|
||||
}
|
||||
}
|
||||
|
||||
cmComputeLinkInformation* pcli = target.GetLinkInformation(config);
|
||||
if (pcli) {
|
||||
cmLinkLineDeviceComputer deviceLinkComputer(
|
||||
|
||||
@@ -4,6 +4,7 @@ ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
|
||||
ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary)
|
||||
ADD_TEST_MACRO(Cuda.MixedStandardLevels MixedStandardLevels)
|
||||
ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled)
|
||||
ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
|
||||
ADD_TEST_MACRO(Cuda.ToolkitInclude CudaToolkitInclude)
|
||||
ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
|
||||
ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags)
|
||||
|
||||
3
Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
Normal file
3
Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
project(SeparableCompCXXOnly LANGUAGES CXX CUDA)
|
||||
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
|
||||
add_executable(SeparableCompCXXOnly main.cpp)
|
||||
5
Tests/Cuda/SeparableCompCXXOnly/main.cpp
Normal file
5
Tests/Cuda/SeparableCompCXXOnly/main.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
int main(int, char const* [])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user