cmMakefile: add GetDefExpandList() that splits value into std::vector

Combines cmMakefile:GetDefinition() and cmExpandList()
This commit is contained in:
Vitaly Stakhovsky
2020-05-30 08:00:00 -04:00
parent 6bb20b51c9
commit 7ed8c9ebe3
16 changed files with 70 additions and 137 deletions

View File

@@ -453,14 +453,12 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeDeviceLinkCmd()
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY: {
const std::string cudaLinkCmd(
this->GetMakefile()->GetDefinition("CMAKE_CUDA_DEVICE_LINK_LIBRARY"));
cmExpandList(cudaLinkCmd, linkCmds);
this->GetMakefile()->GetDefExpandList("CMAKE_CUDA_DEVICE_LINK_LIBRARY",
linkCmds);
} break;
case cmStateEnums::EXECUTABLE: {
const std::string cudaLinkCmd(this->GetMakefile()->GetDefinition(
"CMAKE_CUDA_DEVICE_LINK_EXECUTABLE"));
cmExpandList(cudaLinkCmd, linkCmds);
this->GetMakefile()->GetDefExpandList(
"CMAKE_CUDA_DEVICE_LINK_EXECUTABLE", linkCmds);
} break;
default:
break;
@@ -557,9 +555,8 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
case cmStateEnums::EXECUTABLE:
if (this->TargetLinkLanguage(config) == "Swift") {
if (this->GeneratorTarget->IsExecutableWithExports()) {
const std::string flags =
this->Makefile->GetSafeDefinition("CMAKE_EXE_EXPORTS_Swift_FLAG");
cmExpandList(flags, linkCmds);
this->Makefile->GetDefExpandList("CMAKE_EXE_EXPORTS_Swift_FLAG",
linkCmds);
}
}
break;