From 08fa0b4595566a6e4c29c182865a6ec7e41d9e2e Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 20 Feb 2017 17:05:35 -0500 Subject: CUDA: Fix boolean interpretation of CUDA_SEPARABLE_COMPILATION If the property is explicitly set to a non-true value we should not treat it as true. --- Source/cmMakefileTargetGenerator.cxx | 3 ++- Source/cmNinjaTargetGenerator.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 866c132..54b3f36 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -590,7 +590,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::vector compileCommands; if (lang == "CUDA") { std::string cmdVar; - if (this->GeneratorTarget->GetProperty("CUDA_SEPARABLE_COMPILATION")) { + if (this->GeneratorTarget->GetPropertyAsBool( + "CUDA_SEPARABLE_COMPILATION")) { cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION"); } else { cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION"); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 0b33b19..f096416 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -580,7 +580,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::vector compileCmds; if (lang == "CUDA") { std::string cmdVar; - if (this->GeneratorTarget->GetProperty("CUDA_SEPARABLE_COMPILATION")) { + if (this->GeneratorTarget->GetPropertyAsBool( + "CUDA_SEPARABLE_COMPILATION")) { cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION"); } else { cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION"); -- cgit v0.12