From 1b4c690543451e1907a5b3df23eb76385ab87ada Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sat, 30 May 2020 13:59:57 +0300 Subject: 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. --- Source/cmLocalGenerator.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit v1.2.1