mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-05 22:59:43 -06:00
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.
This commit is contained in:
@@ -590,7 +590,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
|
|||||||
std::vector<std::string> compileCommands;
|
std::vector<std::string> compileCommands;
|
||||||
if (lang == "CUDA") {
|
if (lang == "CUDA") {
|
||||||
std::string cmdVar;
|
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");
|
cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION");
|
||||||
} else {
|
} else {
|
||||||
cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
|
cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
|
||||||
|
|||||||
@@ -580,7 +580,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
|
|||||||
std::vector<std::string> compileCmds;
|
std::vector<std::string> compileCmds;
|
||||||
if (lang == "CUDA") {
|
if (lang == "CUDA") {
|
||||||
std::string cmdVar;
|
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");
|
cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION");
|
||||||
} else {
|
} else {
|
||||||
cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
|
cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
|
||||||
|
|||||||
Reference in New Issue
Block a user