mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user