summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-26 17:13:04 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-10-26 17:13:04 (GMT)
commitd288b216af6864567354ccb05e85466fb57d46b0 (patch)
tree2e3709b4e47c9a9f2cd2983661423668ce7a4064 /Source/cmNinjaNormalTargetGenerator.cxx
parentd71920c45763fe15fa93c2fc1f5aceabba23975e (diff)
parent6cac952b9ed8ad202286ddee7246d9ef7ed8f22d (diff)
downloadCMake-d288b216af6864567354ccb05e85466fb57d46b0.zip
CMake-d288b216af6864567354ccb05e85466fb57d46b0.tar.gz
CMake-d288b216af6864567354ccb05e85466fb57d46b0.tar.bz2
Merge topic 'use-generator-target'
6cac952b VS: Port interface to cmGeneratorTarget 97b37688 VS: Port WriteUtilityDepends to cmGeneratorTarget 600af01d VS: Port utility depends to cmGeneratorTarget 330bfa83 VS: Port target depends to cmGeneratorTarget b13e26e2 VS: Port ProjectDepends to cmGeneratorTarget. 8ac8739b VS: Port TargetIsFortranOnly to cmGeneratorTarget 84fb579f VS: Port WriteProject to cmGeneratorTarget 1eff421a VS: Port loop to cmGeneratorTarget 94fd5a5a VS: Port ImplibDir to cmGeneratorTarget ce9e9a92 VS: Port LinkClosure to cmGeneratorTarget 26e23e84 VS: Port ComputeLongestObjectDirectory to cmGeneratorTarget 01c26986 VS7: Port to cmGeneratorTarget 459c8910 VS10: Port to cmGeneratorTarget. 7f8bb857 VS6: Port to cmGeneratorTarget. a0ebd69b Graphviz: Port to cmGeneratorTarget. bcee21ce C::B: Port API to cmGeneratorTarget. ...
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index dafbda9..b533d37 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -399,7 +399,6 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
{
- cmTarget& target = *this->GetTarget();
cmGeneratorTarget& gt = *this->GetGeneratorTarget();
const std::string cfgName = this->GetConfigName();
std::string targetOutput = ConvertToNinjaPath(
@@ -443,7 +442,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
// Write comments.
cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream());
- const cmState::TargetType targetType = target.GetType();
+ const cmState::TargetType targetType = gt.GetType();
this->GetBuildFileStream()
<< "# Link build statements for "
<< cmState::GetTargetTypeName(targetType)
@@ -490,13 +489,13 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
&genTarget,
useWatcomQuote);
if(this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")
- && target.GetType() == cmState::SHARED_LIBRARY)
+ && gt.GetType() == cmState::SHARED_LIBRARY)
{
- if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+ if(gt.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{
std::string name_of_def_file
= gt.GetSupportDirectory();
- name_of_def_file += "/" + target.GetName();
+ name_of_def_file += "/" + gt.GetName();
name_of_def_file += ".def ";
vars["LINK_FLAGS"] += " /DEF:";
vars["LINK_FLAGS"] += this->GetLocalGenerator()
@@ -505,7 +504,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
}
- this->addPoolNinjaVariable("JOB_POOL_LINK", &target, vars);
+ this->addPoolNinjaVariable("JOB_POOL_LINK", &gt, vars);
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);
vars["LINK_FLAGS"] = cmGlobalNinjaGenerator
@@ -599,9 +598,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
const std::vector<cmCustomCommand> *cmdLists[3] = {
- &target.GetPreBuildCommands(),
- &target.GetPreLinkCommands(),
- &target.GetPostBuildCommands()
+ &gt.Target->GetPreBuildCommands(),
+ &gt.Target->GetPreLinkCommands(),
+ &gt.Target->GetPostBuildCommands()
};
std::vector<std::string> preLinkCmdLines, postBuildCmdLines;
@@ -626,17 +625,17 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
// maybe create .def file from list of objects
- if (target.GetType() == cmState::SHARED_LIBRARY &&
+ if (gt.GetType() == cmState::SHARED_LIBRARY &&
this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS"))
{
- if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
+ if(gt.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS"))
{
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
std::string name_of_def_file
= gt.GetSupportDirectory();
- name_of_def_file += "/" + target.GetName();
+ name_of_def_file += "/" + gt.GetName();
name_of_def_file += ".def";
std::string cmd = cmakeCommand;
cmd += " -E __create_def ";
@@ -699,11 +698,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
const std::string rspfile =
std::string(cmake::GetCMakeFilesDirectoryPostSlash())
- + target.GetName() + ".rsp";
+ + gt.GetName() + ".rsp";
// Gather order-only dependencies.
cmNinjaDeps orderOnlyDeps;
- this->GetLocalGenerator()->AppendTargetDepends(this->GetTarget(),
+ this->GetLocalGenerator()->AppendTargetDepends(this->GetGeneratorTarget(),
orderOnlyDeps);
// Ninja should restat after linking if and only if there are byproducts.
@@ -772,8 +771,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
// Add aliases for the file name and the target name.
- globalGen.AddTargetAlias(this->TargetNameOut, &target);
- globalGen.AddTargetAlias(this->GetTargetName(), &target);
+ globalGen.AddTargetAlias(this->TargetNameOut, &gt);
+ globalGen.AddTargetAlias(this->GetTargetName(), &gt);
}
//----------------------------------------------------------------------------
@@ -781,7 +780,8 @@ void cmNinjaNormalTargetGenerator::WriteObjectLibStatement()
{
// Write a phony output that depends on all object files.
cmNinjaDeps outputs;
- this->GetLocalGenerator()->AppendTargetOutputs(this->GetTarget(), outputs);
+ this->GetLocalGenerator()->AppendTargetOutputs(this->GetGeneratorTarget(),
+ outputs);
cmNinjaDeps depends = this->GetObjects();
this->GetGlobalGenerator()->WritePhonyBuild(this->GetBuildFileStream(),
"Object library "
@@ -791,5 +791,5 @@ void cmNinjaNormalTargetGenerator::WriteObjectLibStatement()
// Add aliases for the target name.
this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(),
- this->GetTarget());
+ this->GetGeneratorTarget());
}