diff options
author | Brad King <brad.king@kitware.com> | 2018-12-05 16:57:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-12-05 19:45:19 (GMT) |
commit | 7b7421346194896109a304ff088630f37ab2bd9e (patch) | |
tree | f640077078c7b5233708b61d49fc29b494b1966e /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 62942969062fcc9f24ca057b6983532a973cfad6 (diff) | |
download | CMake-7b7421346194896109a304ff088630f37ab2bd9e.zip CMake-7b7421346194896109a304ff088630f37ab2bd9e.tar.gz CMake-7b7421346194896109a304ff088630f37ab2bd9e.tar.bz2 |
CUDA: Fix crash on linking to a CUDA target without CUDA enabled
Do not try to device link or add CUDA runtime libraries if the language
is not enabled.
Fixes: #18673
Issue: #18614
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 08bb2ce..846b12c 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -84,6 +84,10 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( bool relink) { #ifdef CMAKE_BUILD_WITH_CMAKE + if (!this->GlobalGenerator->GetLanguageEnabled("CUDA")) { + return; + } + const std::string cuda_lang("CUDA"); cmGeneratorTarget::LinkClosure const* closure = this->GeneratorTarget->GetLinkClosure(this->ConfigName); |