summaryrefslogtreecommitdiff
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-05-30 13:59:57 +0300
committerRaul Tambre <raul@tambre.ee>2020-06-02 22:09:10 +0300
commit1b4c690543451e1907a5b3df23eb76385ab87ada (patch)
tree53c4a5d3bd14281f90a35189f6dd0a904da87032 /Source/cmLocalGenerator.cxx
parent961ca77a7a272fb5cde7e07671a51e9110f9ef36 (diff)
downloadcmake-1b4c690543451e1907a5b3df23eb76385ab87ada.tar.gz
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.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3fca2d4547..288def1ec2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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