summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx42
1 files changed, 24 insertions, 18 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 32ab9f8..210b36e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -239,7 +239,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(
std::string launcher;
const char* val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -307,10 +307,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
// build response file name
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
- const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+ cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
if (flag) {
- responseFlag = flag;
+ responseFlag = *flag;
} else {
responseFlag = "@";
}
@@ -376,7 +376,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
std::string launcher;
const char* val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -478,15 +478,15 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd(
// CMAKE_<lang>_CREATE_STATIC_LIBRARY_IPO define instead.
std::string linkCmdVar = this->GetGeneratorTarget()->GetCreateRuleVariable(
this->TargetLinkLanguage(config), config);
- const char* linkCmd = mf->GetDefinition(linkCmdVar);
+ cmProp linkCmd = mf->GetDefinition(linkCmdVar);
if (linkCmd) {
- std::string linkCmdStr = linkCmd;
+ std::string linkCmdStr = *linkCmd;
if (this->GetGeneratorTarget()->HasImplibGNUtoMS(config)) {
std::string ruleVar =
cmStrCat("CMAKE_", this->GeneratorTarget->GetLinkerLanguage(config),
"_GNUtoMS_RULE");
- if (const char* rule = this->Makefile->GetDefinition(ruleVar)) {
- linkCmdStr += rule;
+ if (cmProp rule = this->Makefile->GetDefinition(ruleVar)) {
+ linkCmdStr += *rule;
}
}
cmExpandList(linkCmdStr, linkCmds);
@@ -739,7 +739,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
// Gather order-only dependencies.
this->GetLocalGenerator()->AppendTargetDepends(
- this->GetGeneratorTarget(), build.OrderOnlyDeps, config, config);
+ this->GetGeneratorTarget(), build.OrderOnlyDeps, config, config,
+ DependOnTargetArtifact);
// Write the build statement for this target.
bool usedResponseFile = false;
@@ -910,11 +911,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
linkBuild.ExplicitDeps.push_back(
this->ConvertToNinjaPath(this->GetSourceFilePath(source)));
}
-
linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
} else {
linkBuild.ExplicitDeps = this->GetObjects(config);
}
+
+ std::vector<std::string> extraISPCObjects =
+ this->GetGeneratorTarget()->GetGeneratedISPCObjects(config);
+ std::transform(extraISPCObjects.begin(), extraISPCObjects.end(),
+ std::back_inserter(linkBuild.ExplicitDeps), MapToNinjaPath());
+
linkBuild.ImplicitDeps =
this->ComputeLinkDeps(this->TargetLinkLanguage(config), config);
@@ -1026,8 +1032,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
gt->GetFullNameComponents(prefix, base, suffix, config);
std::string dbg_suffix = ".dbg";
// TODO: Where to document?
- if (auto d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
- dbg_suffix = d;
+ if (cmProp d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
+ dbg_suffix = *d;
}
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
}
@@ -1090,11 +1096,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmd += this->GetLocalGenerator()->ConvertToOutputFormat(
obj_list_file, cmOutputConverter::SHELL);
- const char* nm_executable = GetMakefile()->GetDefinition("CMAKE_NM");
- if (nm_executable && *nm_executable) {
+ cmProp nm_executable = GetMakefile()->GetDefinition("CMAKE_NM");
+ if (cmNonempty(nm_executable)) {
cmd += " --nm=";
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
- nm_executable, cmOutputConverter::SHELL);
+ *nm_executable, cmOutputConverter::SHELL);
}
preLinkCmdLines.push_back(std::move(cmd));
@@ -1143,7 +1149,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
// build response file name
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
- const char* flag = GetMakefile()->GetDefinition(cmakeLinkVar);
+ cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
bool const lang_supports_response =
!(this->TargetLinkLanguage(config) == "RC" ||
@@ -1160,8 +1166,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp"));
// Gather order-only dependencies.
- this->GetLocalGenerator()->AppendTargetDepends(gt, linkBuild.OrderOnlyDeps,
- config, fileConfig);
+ this->GetLocalGenerator()->AppendTargetDepends(
+ gt, linkBuild.OrderOnlyDeps, config, fileConfig, DependOnTargetArtifact);
// Add order-only dependencies on versioning symlinks of shared libs we link.
if (!this->GeneratorTarget->IsDLLPlatform()) {