CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using Clang

Separable compilation isn't supported yet on Clang.
Let's throw a helpful error instead of confusing errors during the build.
This commit is contained in:
Raul Tambre
2020-05-30 13:59:57 +03:00
parent 961ca77a7a
commit 1b4c690543

View File

@@ -1986,6 +1986,19 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
}
} else if (lang == "CUDA") {
target->AddCUDAArchitectureFlags(flags);
std::string const& compiler =
this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID");
if (compiler == "Clang") {
bool separable = target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION");
if (separable) {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
"CUDA_SEPARABLE_COMPILATION isn't supported on Clang.");
}
}
}
// Add MSVC runtime library flags. This is activated by the presence