|
@@ -554,11 +554,12 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
|
|
|
|
|
|
|
|
void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
{
|
|
{
|
|
|
- if (!this->GetGlobalGenerator()->GetLanguageEnabled("CUDA")) {
|
|
|
|
|
|
|
+ cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
|
|
|
|
|
+ if (!globalGen->GetLanguageEnabled("CUDA")) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cmGeneratorTarget& genTarget = *this->GetGeneratorTarget();
|
|
|
|
|
|
|
+ cmGeneratorTarget* genTarget = this->GetGeneratorTarget();
|
|
|
|
|
|
|
|
bool requiresDeviceLinking = requireDeviceLinking(
|
|
bool requiresDeviceLinking = requireDeviceLinking(
|
|
|
*this->GeneratorTarget, *this->GetLocalGenerator(), this->ConfigName);
|
|
*this->GeneratorTarget, *this->GetLocalGenerator(), this->ConfigName);
|
|
@@ -576,39 +577,39 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
|
|
|
|
|
std::string const cfgName = this->GetConfigName();
|
|
std::string const cfgName = this->GetConfigName();
|
|
|
std::string const targetOutputReal = ConvertToNinjaPath(
|
|
std::string const targetOutputReal = ConvertToNinjaPath(
|
|
|
- genTarget.ObjectDirectory + "cmake_device_link" + objExt);
|
|
|
|
|
|
|
+ genTarget->ObjectDirectory + "cmake_device_link" + objExt);
|
|
|
|
|
|
|
|
std::string const targetOutputImplib = ConvertToNinjaPath(
|
|
std::string const targetOutputImplib = ConvertToNinjaPath(
|
|
|
- genTarget.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
|
|
|
|
|
|
|
+ genTarget->GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
|
|
|
|
|
|
|
|
this->DeviceLinkObject = targetOutputReal;
|
|
this->DeviceLinkObject = targetOutputReal;
|
|
|
|
|
|
|
|
// Write comments.
|
|
// Write comments.
|
|
|
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
|
|
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
|
|
|
- const cmStateEnums::TargetType targetType = genTarget.GetType();
|
|
|
|
|
|
|
+ const cmStateEnums::TargetType targetType = genTarget->GetType();
|
|
|
this->GetBuildFileStream() << "# Device Link build statements for "
|
|
this->GetBuildFileStream() << "# Device Link build statements for "
|
|
|
<< cmState::GetTargetTypeName(targetType)
|
|
<< cmState::GetTargetTypeName(targetType)
|
|
|
<< " target " << this->GetTargetName() << "\n\n";
|
|
<< " target " << this->GetTargetName() << "\n\n";
|
|
|
|
|
|
|
|
// Compute the comment.
|
|
// Compute the comment.
|
|
|
- std::ostringstream comment;
|
|
|
|
|
- comment << "Link the " << this->GetVisibleTypeName() << " "
|
|
|
|
|
- << targetOutputReal;
|
|
|
|
|
|
|
+ cmNinjaBuild build(this->LanguageLinkerDeviceRule());
|
|
|
|
|
+ build.Comment = "Link the ";
|
|
|
|
|
+ build.Comment += this->GetVisibleTypeName();
|
|
|
|
|
+ build.Comment += " ";
|
|
|
|
|
+ build.Comment += targetOutputReal;
|
|
|
|
|
|
|
|
- cmNinjaDeps emptyDeps;
|
|
|
|
|
- cmNinjaVars vars;
|
|
|
|
|
|
|
+ cmNinjaVars& vars = build.Variables;
|
|
|
|
|
|
|
|
// Compute outputs.
|
|
// Compute outputs.
|
|
|
- cmNinjaDeps outputs;
|
|
|
|
|
- outputs.push_back(targetOutputReal);
|
|
|
|
|
|
|
+ build.Outputs.push_back(targetOutputReal);
|
|
|
// Compute specific libraries to link with.
|
|
// Compute specific libraries to link with.
|
|
|
- cmNinjaDeps explicitDeps = this->GetObjects();
|
|
|
|
|
- cmNinjaDeps implicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage);
|
|
|
|
|
|
|
+ build.ExplicitDeps = this->GetObjects();
|
|
|
|
|
+ build.ImplicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage);
|
|
|
|
|
|
|
|
std::string frameworkPath;
|
|
std::string frameworkPath;
|
|
|
std::string linkPath;
|
|
std::string linkPath;
|
|
|
|
|
|
|
|
- std::string createRule = genTarget.GetCreateRuleVariable(
|
|
|
|
|
|
|
+ std::string createRule = genTarget->GetCreateRuleVariable(
|
|
|
this->TargetLinkLanguage, this->GetConfigName());
|
|
this->TargetLinkLanguage, this->GetConfigName());
|
|
|
const bool useWatcomQuote =
|
|
const bool useWatcomQuote =
|
|
|
this->GetMakefile()->IsOn(createRule + "_USE_WATCOM_QUOTE");
|
|
this->GetMakefile()->IsOn(createRule + "_USE_WATCOM_QUOTE");
|
|
@@ -621,14 +622,14 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
new cmNinjaLinkLineDeviceComputer(
|
|
new cmNinjaLinkLineDeviceComputer(
|
|
|
this->GetLocalGenerator(),
|
|
this->GetLocalGenerator(),
|
|
|
this->GetLocalGenerator()->GetStateSnapshot().GetDirectory(),
|
|
this->GetLocalGenerator()->GetStateSnapshot().GetDirectory(),
|
|
|
- this->GetGlobalGenerator()));
|
|
|
|
|
|
|
+ globalGen));
|
|
|
linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
|
|
linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
|
|
|
|
|
|
|
|
localGen.GetTargetFlags(
|
|
localGen.GetTargetFlags(
|
|
|
linkLineComputer.get(), this->GetConfigName(), vars["LINK_LIBRARIES"],
|
|
linkLineComputer.get(), this->GetConfigName(), vars["LINK_LIBRARIES"],
|
|
|
- vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, &genTarget);
|
|
|
|
|
|
|
+ vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, genTarget);
|
|
|
|
|
|
|
|
- this->addPoolNinjaVariable("JOB_POOL_LINK", &genTarget, vars);
|
|
|
|
|
|
|
+ this->addPoolNinjaVariable("JOB_POOL_LINK", genTarget, vars);
|
|
|
|
|
|
|
|
vars["LINK_FLAGS"] =
|
|
vars["LINK_FLAGS"] =
|
|
|
cmGlobalNinjaGenerator::EncodeLiteral(vars["LINK_FLAGS"]);
|
|
cmGlobalNinjaGenerator::EncodeLiteral(vars["LINK_FLAGS"]);
|
|
@@ -642,18 +643,18 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
// code between the Makefile executable and library generators.
|
|
// code between the Makefile executable and library generators.
|
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
|
std::string t = vars["FLAGS"];
|
|
std::string t = vars["FLAGS"];
|
|
|
- localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName);
|
|
|
|
|
|
|
+ localGen.AddArchitectureFlags(t, genTarget, cudaLinkLanguage, cfgName);
|
|
|
vars["FLAGS"] = t;
|
|
vars["FLAGS"] = t;
|
|
|
} else {
|
|
} else {
|
|
|
std::string t = vars["ARCH_FLAGS"];
|
|
std::string t = vars["ARCH_FLAGS"];
|
|
|
- localGen.AddArchitectureFlags(t, &genTarget, cudaLinkLanguage, cfgName);
|
|
|
|
|
|
|
+ localGen.AddArchitectureFlags(t, genTarget, cudaLinkLanguage, cfgName);
|
|
|
vars["ARCH_FLAGS"] = t;
|
|
vars["ARCH_FLAGS"] = t;
|
|
|
t.clear();
|
|
t.clear();
|
|
|
- localGen.AddLanguageFlagsForLinking(t, &genTarget, cudaLinkLanguage,
|
|
|
|
|
|
|
+ localGen.AddLanguageFlagsForLinking(t, genTarget, cudaLinkLanguage,
|
|
|
cfgName);
|
|
cfgName);
|
|
|
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
|
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
|
|
}
|
|
}
|
|
|
- if (this->GetGeneratorTarget()->HasSOName(cfgName)) {
|
|
|
|
|
|
|
+ if (genTarget->HasSOName(cfgName)) {
|
|
|
vars["SONAME_FLAG"] =
|
|
vars["SONAME_FLAG"] =
|
|
|
this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage);
|
|
this->GetMakefile()->GetSONameFlag(this->TargetLinkLanguage);
|
|
|
vars["SONAME"] = this->TargetNames.SharedObject;
|
|
vars["SONAME"] = this->TargetNames.SharedObject;
|
|
@@ -681,7 +682,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
|
|
|
|
|
this->SetMsvcTargetPdbVariable(vars);
|
|
this->SetMsvcTargetPdbVariable(vars);
|
|
|
|
|
|
|
|
- if (this->GetGlobalGenerator()->IsGCCOnWindows()) {
|
|
|
|
|
|
|
+ if (globalGen->IsGCCOnWindows()) {
|
|
|
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
|
|
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
|
|
|
std::string& linkLibraries = vars["LINK_LIBRARIES"];
|
|
std::string& linkLibraries = vars["LINK_LIBRARIES"];
|
|
|
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
|
|
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
|
|
@@ -689,46 +690,43 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
|
|
|
std::replace(link_path.begin(), link_path.end(), '\\', '/');
|
|
std::replace(link_path.begin(), link_path.end(), '\\', '/');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();
|
|
|
|
|
-
|
|
|
|
|
// Device linking currently doesn't support response files so
|
|
// Device linking currently doesn't support response files so
|
|
|
// do not check if the user has explicitly forced a response file.
|
|
// do not check if the user has explicitly forced a response file.
|
|
|
int const commandLineLengthLimit =
|
|
int const commandLineLengthLimit =
|
|
|
static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
|
|
static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
|
|
|
- globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule());
|
|
|
|
|
|
|
+ globalGen->GetRuleCmdLength(this->LanguageLinkerDeviceRule());
|
|
|
|
|
|
|
|
- const std::string rspfile = this->ConvertToNinjaPath(
|
|
|
|
|
- std::string("CMakeFiles/") + genTarget.GetName() + ".rsp");
|
|
|
|
|
|
|
+ build.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") +
|
|
|
|
|
+ genTarget->GetName() + ".rsp");
|
|
|
|
|
|
|
|
// Gather order-only dependencies.
|
|
// Gather order-only dependencies.
|
|
|
- cmNinjaDeps orderOnlyDeps;
|
|
|
|
|
this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(),
|
|
this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(),
|
|
|
- orderOnlyDeps);
|
|
|
|
|
|
|
+ build.OrderOnlyDeps);
|
|
|
|
|
|
|
|
// Write the build statement for this target.
|
|
// Write the build statement for this target.
|
|
|
bool usedResponseFile = false;
|
|
bool usedResponseFile = false;
|
|
|
- globalGen.WriteBuild(this->GetBuildFileStream(), comment.str(),
|
|
|
|
|
- this->LanguageLinkerDeviceRule(), outputs,
|
|
|
|
|
- /*implicitOuts=*/cmNinjaDeps(), explicitDeps,
|
|
|
|
|
- implicitDeps, orderOnlyDeps, vars, rspfile,
|
|
|
|
|
- commandLineLengthLimit, &usedResponseFile);
|
|
|
|
|
|
|
+ globalGen->WriteBuild(this->GetBuildFileStream(), build,
|
|
|
|
|
+ commandLineLengthLimit, &usedResponseFile);
|
|
|
this->WriteDeviceLinkRule(false);
|
|
this->WriteDeviceLinkRule(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
{
|
|
{
|
|
|
- cmGeneratorTarget& gt = *this->GetGeneratorTarget();
|
|
|
|
|
|
|
+ cmMakefile* mf = this->GetMakefile();
|
|
|
|
|
+ cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
|
|
|
|
|
+ cmGeneratorTarget* gt = this->GetGeneratorTarget();
|
|
|
|
|
+
|
|
|
const std::string cfgName = this->GetConfigName();
|
|
const std::string cfgName = this->GetConfigName();
|
|
|
- std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
|
|
|
|
|
|
|
+ std::string targetOutput = ConvertToNinjaPath(gt->GetFullPath(cfgName));
|
|
|
std::string targetOutputReal = ConvertToNinjaPath(
|
|
std::string targetOutputReal = ConvertToNinjaPath(
|
|
|
- gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
|
|
|
|
|
- /*realname=*/true));
|
|
|
|
|
|
|
+ gt->GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
|
|
|
|
|
+ /*realname=*/true));
|
|
|
std::string targetOutputImplib = ConvertToNinjaPath(
|
|
std::string targetOutputImplib = ConvertToNinjaPath(
|
|
|
- gt.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
|
|
|
|
|
|
|
+ gt->GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
|
|
|
|
|
|
|
|
- if (gt.IsAppBundleOnApple()) {
|
|
|
|
|
|
|
+ if (gt->IsAppBundleOnApple()) {
|
|
|
// Create the app bundle
|
|
// Create the app bundle
|
|
|
- std::string outpath = gt.GetDirectory(cfgName);
|
|
|
|
|
|
|
+ std::string outpath = gt->GetDirectory(cfgName);
|
|
|
this->OSXBundleGenerator->CreateAppBundle(this->TargetNames.Output,
|
|
this->OSXBundleGenerator->CreateAppBundle(this->TargetNames.Output,
|
|
|
outpath);
|
|
outpath);
|
|
|
|
|
|
|
@@ -741,34 +739,34 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
targetOutputReal += "/";
|
|
targetOutputReal += "/";
|
|
|
targetOutputReal += this->TargetNames.Real;
|
|
targetOutputReal += this->TargetNames.Real;
|
|
|
targetOutputReal = this->ConvertToNinjaPath(targetOutputReal);
|
|
targetOutputReal = this->ConvertToNinjaPath(targetOutputReal);
|
|
|
- } else if (gt.IsFrameworkOnApple()) {
|
|
|
|
|
|
|
+ } else if (gt->IsFrameworkOnApple()) {
|
|
|
// Create the library framework.
|
|
// Create the library framework.
|
|
|
this->OSXBundleGenerator->CreateFramework(this->TargetNames.Output,
|
|
this->OSXBundleGenerator->CreateFramework(this->TargetNames.Output,
|
|
|
- gt.GetDirectory(cfgName));
|
|
|
|
|
- } else if (gt.IsCFBundleOnApple()) {
|
|
|
|
|
|
|
+ gt->GetDirectory(cfgName));
|
|
|
|
|
+ } else if (gt->IsCFBundleOnApple()) {
|
|
|
// Create the core foundation bundle.
|
|
// Create the core foundation bundle.
|
|
|
this->OSXBundleGenerator->CreateCFBundle(this->TargetNames.Output,
|
|
this->OSXBundleGenerator->CreateCFBundle(this->TargetNames.Output,
|
|
|
- gt.GetDirectory(cfgName));
|
|
|
|
|
|
|
+ gt->GetDirectory(cfgName));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Write comments.
|
|
// Write comments.
|
|
|
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
|
|
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
|
|
|
- const cmStateEnums::TargetType targetType = gt.GetType();
|
|
|
|
|
|
|
+ const cmStateEnums::TargetType targetType = gt->GetType();
|
|
|
this->GetBuildFileStream()
|
|
this->GetBuildFileStream()
|
|
|
<< "# Link build statements for " << cmState::GetTargetTypeName(targetType)
|
|
<< "# Link build statements for " << cmState::GetTargetTypeName(targetType)
|
|
|
<< " target " << this->GetTargetName() << "\n\n";
|
|
<< " target " << this->GetTargetName() << "\n\n";
|
|
|
|
|
|
|
|
- cmNinjaDeps emptyDeps;
|
|
|
|
|
- cmNinjaVars vars;
|
|
|
|
|
|
|
+ cmNinjaBuild linkBuild(this->LanguageLinkerRule());
|
|
|
|
|
+ cmNinjaVars& vars = linkBuild.Variables;
|
|
|
|
|
|
|
|
// Compute the comment.
|
|
// Compute the comment.
|
|
|
- std::ostringstream comment;
|
|
|
|
|
- comment << "Link the " << this->GetVisibleTypeName() << " "
|
|
|
|
|
- << targetOutputReal;
|
|
|
|
|
|
|
+ linkBuild.Comment = "Link the ";
|
|
|
|
|
+ linkBuild.Comment += this->GetVisibleTypeName();
|
|
|
|
|
+ linkBuild.Comment += " ";
|
|
|
|
|
+ linkBuild.Comment += targetOutputReal;
|
|
|
|
|
|
|
|
// Compute outputs.
|
|
// Compute outputs.
|
|
|
- cmNinjaDeps outputs;
|
|
|
|
|
- outputs.push_back(targetOutputReal);
|
|
|
|
|
|
|
+ linkBuild.Outputs.push_back(targetOutputReal);
|
|
|
|
|
|
|
|
if (this->TargetLinkLanguage == "Swift") {
|
|
if (this->TargetLinkLanguage == "Swift") {
|
|
|
vars["SWIFT_LIBRARY_NAME"] = [this]() -> std::string {
|
|
vars["SWIFT_LIBRARY_NAME"] = [this]() -> std::string {
|
|
@@ -777,12 +775,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
return targetNames.Base;
|
|
return targetNames.Base;
|
|
|
}();
|
|
}();
|
|
|
|
|
|
|
|
- vars["SWIFT_MODULE_NAME"] = [this]() -> std::string {
|
|
|
|
|
- if (const char* name =
|
|
|
|
|
- this->GetGeneratorTarget()->GetProperty("Swift_MODULE_NAME")) {
|
|
|
|
|
|
|
+ vars["SWIFT_MODULE_NAME"] = [gt]() -> std::string {
|
|
|
|
|
+ if (const char* name = gt->GetProperty("Swift_MODULE_NAME")) {
|
|
|
return name;
|
|
return name;
|
|
|
}
|
|
}
|
|
|
- return this->GetGeneratorTarget()->GetName();
|
|
|
|
|
|
|
+ return gt->GetName();
|
|
|
}();
|
|
}();
|
|
|
|
|
|
|
|
vars["SWIFT_MODULE"] = [this](const std::string& module) -> std::string {
|
|
vars["SWIFT_MODULE"] = [this](const std::string& module) -> std::string {
|
|
@@ -806,7 +803,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
|
|
|
|
|
vars["SWIFT_OUTPUT_FILE_MAP"] =
|
|
vars["SWIFT_OUTPUT_FILE_MAP"] =
|
|
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
|
- this->ConvertToNinjaPath(gt.GetSupportDirectory() +
|
|
|
|
|
|
|
+ this->ConvertToNinjaPath(gt->GetSupportDirectory() +
|
|
|
"/output-file-map.json"),
|
|
"/output-file-map.json"),
|
|
|
cmOutputConverter::SHELL);
|
|
cmOutputConverter::SHELL);
|
|
|
|
|
|
|
@@ -835,35 +832,31 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Compute specific libraries to link with.
|
|
// Compute specific libraries to link with.
|
|
|
- cmNinjaDeps explicitDeps;
|
|
|
|
|
if (this->TargetLinkLanguage == "Swift") {
|
|
if (this->TargetLinkLanguage == "Swift") {
|
|
|
std::vector<cmSourceFile const*> sources;
|
|
std::vector<cmSourceFile const*> sources;
|
|
|
- this->GetGeneratorTarget()->GetObjectSources(sources,
|
|
|
|
|
- this->GetConfigName());
|
|
|
|
|
|
|
+ gt->GetObjectSources(sources, this->GetConfigName());
|
|
|
for (const auto& source : sources) {
|
|
for (const auto& source : sources) {
|
|
|
- outputs.push_back(
|
|
|
|
|
|
|
+ linkBuild.Outputs.push_back(
|
|
|
this->ConvertToNinjaPath(this->GetObjectFilePath(source)));
|
|
this->ConvertToNinjaPath(this->GetObjectFilePath(source)));
|
|
|
- explicitDeps.push_back(
|
|
|
|
|
|
|
+ linkBuild.ExplicitDeps.push_back(
|
|
|
this->ConvertToNinjaPath(this->GetSourceFilePath(source)));
|
|
this->ConvertToNinjaPath(this->GetSourceFilePath(source)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- outputs.push_back(vars["SWIFT_MODULE"]);
|
|
|
|
|
|
|
+ linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]);
|
|
|
} else {
|
|
} else {
|
|
|
- explicitDeps = this->GetObjects();
|
|
|
|
|
|
|
+ linkBuild.ExplicitDeps = this->GetObjects();
|
|
|
}
|
|
}
|
|
|
- cmNinjaDeps implicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage);
|
|
|
|
|
|
|
+ linkBuild.ImplicitDeps = this->ComputeLinkDeps(this->TargetLinkLanguage);
|
|
|
|
|
|
|
|
if (!this->DeviceLinkObject.empty()) {
|
|
if (!this->DeviceLinkObject.empty()) {
|
|
|
- explicitDeps.push_back(this->DeviceLinkObject);
|
|
|
|
|
|
|
+ linkBuild.ExplicitDeps.push_back(this->DeviceLinkObject);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cmMakefile* mf = this->GetMakefile();
|
|
|
|
|
-
|
|
|
|
|
std::string frameworkPath;
|
|
std::string frameworkPath;
|
|
|
std::string linkPath;
|
|
std::string linkPath;
|
|
|
|
|
|
|
|
std::string createRule =
|
|
std::string createRule =
|
|
|
- gt.GetCreateRuleVariable(this->TargetLinkLanguage, this->GetConfigName());
|
|
|
|
|
|
|
+ gt->GetCreateRuleVariable(this->TargetLinkLanguage, this->GetConfigName());
|
|
|
bool useWatcomQuote = mf->IsOn(createRule + "_USE_WATCOM_QUOTE");
|
|
bool useWatcomQuote = mf->IsOn(createRule + "_USE_WATCOM_QUOTE");
|
|
|
cmLocalNinjaGenerator& localGen = *this->GetLocalGenerator();
|
|
cmLocalNinjaGenerator& localGen = *this->GetLocalGenerator();
|
|
|
|
|
|
|
@@ -871,14 +864,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
localGen.ConvertToOutputFormat(targetOutputReal, cmOutputConverter::SHELL);
|
|
localGen.ConvertToOutputFormat(targetOutputReal, cmOutputConverter::SHELL);
|
|
|
|
|
|
|
|
std::unique_ptr<cmLinkLineComputer> linkLineComputer(
|
|
std::unique_ptr<cmLinkLineComputer> linkLineComputer(
|
|
|
- this->GetGlobalGenerator()->CreateLinkLineComputer(
|
|
|
|
|
|
|
+ globalGen->CreateLinkLineComputer(
|
|
|
this->GetLocalGenerator(),
|
|
this->GetLocalGenerator(),
|
|
|
this->GetLocalGenerator()->GetStateSnapshot().GetDirectory()));
|
|
this->GetLocalGenerator()->GetStateSnapshot().GetDirectory()));
|
|
|
linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
|
|
linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
|
|
|
|
|
|
|
|
localGen.GetTargetFlags(linkLineComputer.get(), this->GetConfigName(),
|
|
localGen.GetTargetFlags(linkLineComputer.get(), this->GetConfigName(),
|
|
|
vars["LINK_LIBRARIES"], vars["FLAGS"],
|
|
vars["LINK_LIBRARIES"], vars["FLAGS"],
|
|
|
- vars["LINK_FLAGS"], frameworkPath, linkPath, >);
|
|
|
|
|
|
|
+ vars["LINK_FLAGS"], frameworkPath, linkPath, gt);
|
|
|
|
|
|
|
|
// Add OS X version flags, if any.
|
|
// Add OS X version flags, if any.
|
|
|
if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
|
if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
|
@@ -889,7 +882,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
"CURRENT", false);
|
|
"CURRENT", false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this->addPoolNinjaVariable("JOB_POOL_LINK", >, vars);
|
|
|
|
|
|
|
+ this->addPoolNinjaVariable("JOB_POOL_LINK", gt, vars);
|
|
|
|
|
|
|
|
this->AddModuleDefinitionFlag(linkLineComputer.get(), vars["LINK_FLAGS"]);
|
|
this->AddModuleDefinitionFlag(linkLineComputer.get(), vars["LINK_FLAGS"]);
|
|
|
vars["LINK_FLAGS"] =
|
|
vars["LINK_FLAGS"] =
|
|
@@ -899,7 +892,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
|
|
|
|
|
vars["LINK_PATH"] = frameworkPath + linkPath;
|
|
vars["LINK_PATH"] = frameworkPath + linkPath;
|
|
|
std::string lwyuFlags;
|
|
std::string lwyuFlags;
|
|
|
- if (gt.GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
|
|
|
|
|
|
|
+ if (gt->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
|
|
|
lwyuFlags = " -Wl,--no-as-needed";
|
|
lwyuFlags = " -Wl,--no-as-needed";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -908,24 +901,23 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
// code between the Makefile executable and library generators.
|
|
// code between the Makefile executable and library generators.
|
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
|
std::string t = vars["FLAGS"];
|
|
std::string t = vars["FLAGS"];
|
|
|
- localGen.AddArchitectureFlags(t, >, TargetLinkLanguage, cfgName);
|
|
|
|
|
|
|
+ localGen.AddArchitectureFlags(t, gt, TargetLinkLanguage, cfgName);
|
|
|
t += lwyuFlags;
|
|
t += lwyuFlags;
|
|
|
vars["FLAGS"] = t;
|
|
vars["FLAGS"] = t;
|
|
|
} else {
|
|
} else {
|
|
|
std::string t = vars["ARCH_FLAGS"];
|
|
std::string t = vars["ARCH_FLAGS"];
|
|
|
- localGen.AddArchitectureFlags(t, >, TargetLinkLanguage, cfgName);
|
|
|
|
|
|
|
+ localGen.AddArchitectureFlags(t, gt, TargetLinkLanguage, cfgName);
|
|
|
vars["ARCH_FLAGS"] = t;
|
|
vars["ARCH_FLAGS"] = t;
|
|
|
t.clear();
|
|
t.clear();
|
|
|
t += lwyuFlags;
|
|
t += lwyuFlags;
|
|
|
- localGen.AddLanguageFlagsForLinking(t, >, TargetLinkLanguage, cfgName);
|
|
|
|
|
|
|
+ localGen.AddLanguageFlagsForLinking(t, gt, TargetLinkLanguage, cfgName);
|
|
|
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
|
vars["LANGUAGE_COMPILE_FLAGS"] = t;
|
|
|
}
|
|
}
|
|
|
- if (this->GetGeneratorTarget()->HasSOName(cfgName)) {
|
|
|
|
|
|
|
+ if (gt->HasSOName(cfgName)) {
|
|
|
vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
|
|
vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage);
|
|
|
vars["SONAME"] = this->TargetNames.SharedObject;
|
|
vars["SONAME"] = this->TargetNames.SharedObject;
|
|
|
if (targetType == cmStateEnums::SHARED_LIBRARY) {
|
|
if (targetType == cmStateEnums::SHARED_LIBRARY) {
|
|
|
- std::string install_dir =
|
|
|
|
|
- this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName);
|
|
|
|
|
|
|
+ std::string install_dir = gt->GetInstallNameDirForBuildTree(cfgName);
|
|
|
if (!install_dir.empty()) {
|
|
if (!install_dir.empty()) {
|
|
|
vars["INSTALLNAME_DIR"] = localGen.ConvertToOutputFormat(
|
|
vars["INSTALLNAME_DIR"] = localGen.ConvertToOutputFormat(
|
|
|
install_dir, cmOutputConverter::SHELL);
|
|
install_dir, cmOutputConverter::SHELL);
|
|
@@ -940,7 +932,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
targetOutputImplib, cmOutputConverter::SHELL);
|
|
targetOutputImplib, cmOutputConverter::SHELL);
|
|
|
vars["TARGET_IMPLIB"] = impLibPath;
|
|
vars["TARGET_IMPLIB"] = impLibPath;
|
|
|
EnsureParentDirectoryExists(impLibPath);
|
|
EnsureParentDirectoryExists(impLibPath);
|
|
|
- if (gt.HasImportLibrary(cfgName)) {
|
|
|
|
|
|
|
+ if (gt->HasImportLibrary(cfgName)) {
|
|
|
byproducts.push_back(targetOutputImplib);
|
|
byproducts.push_back(targetOutputImplib);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -951,7 +943,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
std::string prefix;
|
|
std::string prefix;
|
|
|
std::string base;
|
|
std::string base;
|
|
|
std::string suffix;
|
|
std::string suffix;
|
|
|
- this->GetGeneratorTarget()->GetFullNameComponents(prefix, base, suffix);
|
|
|
|
|
|
|
+ gt->GetFullNameComponents(prefix, base, suffix);
|
|
|
std::string dbg_suffix = ".dbg";
|
|
std::string dbg_suffix = ".dbg";
|
|
|
// TODO: Where to document?
|
|
// TODO: Where to document?
|
|
|
if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
|
|
if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
|
|
@@ -960,12 +952,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
|
|
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const std::string objPath = GetGeneratorTarget()->GetSupportDirectory();
|
|
|
|
|
|
|
+ const std::string objPath = gt->GetSupportDirectory();
|
|
|
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
|
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
|
|
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
|
|
|
EnsureDirectoryExists(objPath);
|
|
EnsureDirectoryExists(objPath);
|
|
|
|
|
|
|
|
- if (this->GetGlobalGenerator()->IsGCCOnWindows()) {
|
|
|
|
|
|
|
+ if (globalGen->IsGCCOnWindows()) {
|
|
|
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
|
|
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
|
|
|
std::string& linkLibraries = vars["LINK_LIBRARIES"];
|
|
std::string& linkLibraries = vars["LINK_LIBRARIES"];
|
|
|
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
|
|
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
|
|
@@ -974,8 +966,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const std::vector<cmCustomCommand>* cmdLists[3] = {
|
|
const std::vector<cmCustomCommand>* cmdLists[3] = {
|
|
|
- >.GetPreBuildCommands(), >.GetPreLinkCommands(),
|
|
|
|
|
- >.GetPostBuildCommands()
|
|
|
|
|
|
|
+ >->GetPreBuildCommands(), >->GetPreLinkCommands(),
|
|
|
|
|
+ >->GetPostBuildCommands()
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
std::vector<std::string> preLinkCmdLines, postBuildCmdLines;
|
|
std::vector<std::string> preLinkCmdLines, postBuildCmdLines;
|
|
@@ -995,7 +987,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
|
|
|
|
|
// maybe create .def file from list of objects
|
|
// maybe create .def file from list of objects
|
|
|
cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
|
|
cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
|
|
|
- gt.GetModuleDefinitionInfo(this->GetConfigName());
|
|
|
|
|
|
|
+ gt->GetModuleDefinitionInfo(this->GetConfigName());
|
|
|
if (mdi && mdi->DefFileGenerated) {
|
|
if (mdi && mdi->DefFileGenerated) {
|
|
|
std::string cmakeCommand =
|
|
std::string cmakeCommand =
|
|
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
@@ -1027,8 +1019,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// If we have any PRE_LINK commands, we need to go back to CMAKE_BINARY_DIR
|
|
// If we have any PRE_LINK commands, we need to go back to CMAKE_BINARY_DIR
|
|
|
- // for
|
|
|
|
|
- // the link commands.
|
|
|
|
|
|
|
+ // for the link commands.
|
|
|
if (!preLinkCmdLines.empty()) {
|
|
if (!preLinkCmdLines.empty()) {
|
|
|
const std::string homeOutDir = localGen.ConvertToOutputFormat(
|
|
const std::string homeOutDir = localGen.ConvertToOutputFormat(
|
|
|
localGen.GetBinaryDirectory(), cmOutputConverter::SHELL);
|
|
localGen.GetBinaryDirectory(), cmOutputConverter::SHELL);
|
|
@@ -1042,14 +1033,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
|
|
|
|
|
cmNinjaVars symlinkVars;
|
|
cmNinjaVars symlinkVars;
|
|
|
bool const symlinkNeeded =
|
|
bool const symlinkNeeded =
|
|
|
- (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple());
|
|
|
|
|
|
|
+ (targetOutput != targetOutputReal && !gt->IsFrameworkOnApple());
|
|
|
if (!symlinkNeeded) {
|
|
if (!symlinkNeeded) {
|
|
|
vars["POST_BUILD"] = postBuildCmdLine;
|
|
vars["POST_BUILD"] = postBuildCmdLine;
|
|
|
} else {
|
|
} else {
|
|
|
vars["POST_BUILD"] = cmGlobalNinjaGenerator::SHELL_NOOP;
|
|
vars["POST_BUILD"] = cmGlobalNinjaGenerator::SHELL_NOOP;
|
|
|
symlinkVars["POST_BUILD"] = postBuildCmdLine;
|
|
symlinkVars["POST_BUILD"] = postBuildCmdLine;
|
|
|
}
|
|
}
|
|
|
- cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();
|
|
|
|
|
|
|
|
|
|
bool const lang_supports_response =
|
|
bool const lang_supports_response =
|
|
|
!(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA");
|
|
!(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA");
|
|
@@ -1057,44 +1047,41 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
if (!lang_supports_response || !this->ForceResponseFile()) {
|
|
if (!lang_supports_response || !this->ForceResponseFile()) {
|
|
|
commandLineLengthLimit =
|
|
commandLineLengthLimit =
|
|
|
static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
|
|
static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
|
|
|
- globalGen.GetRuleCmdLength(this->LanguageLinkerRule());
|
|
|
|
|
|
|
+ globalGen->GetRuleCmdLength(linkBuild.Rule);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const std::string rspfile = this->ConvertToNinjaPath(
|
|
|
|
|
- std::string("CMakeFiles/") + gt.GetName() + ".rsp");
|
|
|
|
|
|
|
+ linkBuild.RspFile = this->ConvertToNinjaPath(std::string("CMakeFiles/") +
|
|
|
|
|
+ gt->GetName() + ".rsp");
|
|
|
|
|
|
|
|
// Gather order-only dependencies.
|
|
// Gather order-only dependencies.
|
|
|
- cmNinjaDeps orderOnlyDeps;
|
|
|
|
|
- this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(),
|
|
|
|
|
- orderOnlyDeps);
|
|
|
|
|
|
|
+ this->GetLocalGenerator()->AppendTargetDepends(gt, linkBuild.OrderOnlyDeps);
|
|
|
|
|
|
|
|
// Ninja should restat after linking if and only if there are byproducts.
|
|
// Ninja should restat after linking if and only if there are byproducts.
|
|
|
vars["RESTAT"] = byproducts.empty() ? "" : "1";
|
|
vars["RESTAT"] = byproducts.empty() ? "" : "1";
|
|
|
|
|
|
|
|
for (std::string const& o : byproducts) {
|
|
for (std::string const& o : byproducts) {
|
|
|
- this->GetGlobalGenerator()->SeenCustomCommandOutput(o);
|
|
|
|
|
- outputs.push_back(o);
|
|
|
|
|
|
|
+ globalGen->SeenCustomCommandOutput(o);
|
|
|
|
|
+ linkBuild.Outputs.push_back(o);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Write the build statement for this target.
|
|
// Write the build statement for this target.
|
|
|
bool usedResponseFile = false;
|
|
bool usedResponseFile = false;
|
|
|
- globalGen.WriteBuild(this->GetBuildFileStream(), comment.str(),
|
|
|
|
|
- this->LanguageLinkerRule(), outputs,
|
|
|
|
|
- /*implicitOuts=*/cmNinjaDeps(), explicitDeps,
|
|
|
|
|
- implicitDeps, orderOnlyDeps, vars, rspfile,
|
|
|
|
|
- commandLineLengthLimit, &usedResponseFile);
|
|
|
|
|
|
|
+ globalGen->WriteBuild(this->GetBuildFileStream(), linkBuild,
|
|
|
|
|
+ commandLineLengthLimit, &usedResponseFile);
|
|
|
this->WriteLinkRule(usedResponseFile);
|
|
this->WriteLinkRule(usedResponseFile);
|
|
|
|
|
|
|
|
if (symlinkNeeded) {
|
|
if (symlinkNeeded) {
|
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
if (targetType == cmStateEnums::EXECUTABLE) {
|
|
|
- globalGen.WriteBuild(
|
|
|
|
|
- this->GetBuildFileStream(),
|
|
|
|
|
- "Create executable symlink " + targetOutput,
|
|
|
|
|
- "CMAKE_SYMLINK_EXECUTABLE", cmNinjaDeps(1, targetOutput),
|
|
|
|
|
- /*implicitOuts=*/cmNinjaDeps(), cmNinjaDeps(1, targetOutputReal),
|
|
|
|
|
- emptyDeps, emptyDeps, symlinkVars);
|
|
|
|
|
|
|
+ cmNinjaBuild build("CMAKE_SYMLINK_EXECUTABLE");
|
|
|
|
|
+ build.Comment = "Create executable symlink " + targetOutput;
|
|
|
|
|
+ build.Outputs.push_back(targetOutput);
|
|
|
|
|
+ build.ExplicitDeps.push_back(targetOutputReal);
|
|
|
|
|
+ build.Variables = std::move(symlinkVars);
|
|
|
|
|
+ globalGen->WriteBuild(this->GetBuildFileStream(), build);
|
|
|
} else {
|
|
} else {
|
|
|
- cmNinjaDeps symlinks;
|
|
|
|
|
|
|
+ cmNinjaBuild build("CMAKE_SYMLINK_LIBRARY");
|
|
|
|
|
+ build.Comment = "Create library symlink " + targetOutput;
|
|
|
|
|
+
|
|
|
std::string const soName = this->ConvertToNinjaPath(
|
|
std::string const soName = this->ConvertToNinjaPath(
|
|
|
this->GetTargetFilePath(this->TargetNames.SharedObject));
|
|
this->GetTargetFilePath(this->TargetNames.SharedObject));
|
|
|
// If one link has to be created.
|
|
// If one link has to be created.
|
|
@@ -1104,32 +1091,32 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|
|
soName, cmOutputConverter::SHELL);
|
|
soName, cmOutputConverter::SHELL);
|
|
|
} else {
|
|
} else {
|
|
|
symlinkVars["SONAME"].clear();
|
|
symlinkVars["SONAME"].clear();
|
|
|
- symlinks.push_back(soName);
|
|
|
|
|
|
|
+ build.Outputs.push_back(soName);
|
|
|
}
|
|
}
|
|
|
- symlinks.push_back(targetOutput);
|
|
|
|
|
- globalGen.WriteBuild(
|
|
|
|
|
- this->GetBuildFileStream(), "Create library symlink " + targetOutput,
|
|
|
|
|
- "CMAKE_SYMLINK_LIBRARY", symlinks,
|
|
|
|
|
- /*implicitOuts=*/cmNinjaDeps(), cmNinjaDeps(1, targetOutputReal),
|
|
|
|
|
- emptyDeps, emptyDeps, symlinkVars);
|
|
|
|
|
|
|
+ build.Outputs.push_back(targetOutput);
|
|
|
|
|
+ build.ExplicitDeps.push_back(targetOutputReal);
|
|
|
|
|
+ build.Variables = std::move(symlinkVars);
|
|
|
|
|
+
|
|
|
|
|
+ globalGen->WriteBuild(this->GetBuildFileStream(), build);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Add aliases for the file name and the target name.
|
|
// Add aliases for the file name and the target name.
|
|
|
- globalGen.AddTargetAlias(this->TargetNames.Output, >);
|
|
|
|
|
- globalGen.AddTargetAlias(this->GetTargetName(), >);
|
|
|
|
|
|
|
+ globalGen->AddTargetAlias(this->TargetNames.Output, gt);
|
|
|
|
|
+ globalGen->AddTargetAlias(this->GetTargetName(), gt);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void cmNinjaNormalTargetGenerator::WriteObjectLibStatement()
|
|
void cmNinjaNormalTargetGenerator::WriteObjectLibStatement()
|
|
|
{
|
|
{
|
|
|
// Write a phony output that depends on all object files.
|
|
// Write a phony output that depends on all object files.
|
|
|
- cmNinjaDeps outputs;
|
|
|
|
|
- this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(),
|
|
|
|
|
- outputs);
|
|
|
|
|
- cmNinjaDeps depends = this->GetObjects();
|
|
|
|
|
- this->GetGlobalGenerator()->WritePhonyBuild(
|
|
|
|
|
- this->GetBuildFileStream(), "Object library " + this->GetTargetName(),
|
|
|
|
|
- outputs, depends);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ cmNinjaBuild build("phony");
|
|
|
|
|
+ build.Comment = "Object library " + this->GetTargetName();
|
|
|
|
|
+ this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(),
|
|
|
|
|
+ build.Outputs);
|
|
|
|
|
+ build.ExplicitDeps = this->GetObjects();
|
|
|
|
|
+ this->GetGlobalGenerator()->WriteBuild(this->GetBuildFileStream(), build);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// Add aliases for the target name.
|
|
// Add aliases for the target name.
|
|
|
this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(),
|
|
this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(),
|