diff options
author | Raul Tambre <raul@tambre.ee> | 2020-05-30 10:59:57 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-06-02 19:09:10 (GMT) |
commit | 1b4c690543451e1907a5b3df23eb76385ab87ada (patch) | |
tree | 53c4a5d3bd14281f90a35189f6dd0a904da87032 /Source/cmLocalGenerator.cxx | |
parent | 961ca77a7a272fb5cde7e07671a51e9110f9ef36 (diff) | |
download | CMake-1b4c690543451e1907a5b3df23eb76385ab87ada.zip CMake-1b4c690543451e1907a5b3df23eb76385ab87ada.tar.gz CMake-1b4c690543451e1907a5b3df23eb76385ab87ada.tar.bz2 |
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.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3fca2d4..288def1 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 |