summaryrefslogtreecommitdiff
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-12 21:09:20 +0100
committerStephen Kelly <steveire@gmail.com>2014-03-13 15:27:23 +0100
commitcd43433de56ab31269a076fb2b2ace8babaa107d (patch)
tree3cfc978af258b7b0fc0b046b3d99be1b4cd01254 /Source/cmGlobalNinjaGenerator.cxx
parentd5b2e33be2119ad12744ed62920a8f8d9b6d705d (diff)
downloadcmake-cd43433de56ab31269a076fb2b2ace8babaa107d.tar.gz
cmGlobalGenerator: Extract a ComputeTargetObjectDirectory interface.
Make it public for future external calls.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx27
1 files changed, 16 insertions, 11 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 0a05f5a3ef..686414d3fc 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -634,16 +634,6 @@ std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const
// TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl.
void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
{
- cmTarget* target = gt->Target;
-
- // Compute full path to object file directory for this target.
- std::string dir_max;
- dir_max += gt->Makefile->GetCurrentOutputDirectory();
- dir_max += "/";
- dir_max += gt->LocalGenerator->GetTargetDirectory(*target);
- dir_max += "/";
- gt->ObjectDirectory = dir_max;
-
std::vector<cmSourceFile*> objectSources;
gt->GetObjectSources(objectSources);
// Compute the name of each object file.
@@ -653,12 +643,27 @@ void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
{
cmSourceFile* sf = *si;
std::string objectName = gt->LocalGenerator
- ->GetObjectFileNameWithoutTarget(*sf, dir_max);
+ ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
gt->AddObject(sf, objectName);
}
}
//----------------------------------------------------------------------------
+void cmGlobalNinjaGenerator
+::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
+{
+ cmTarget* target = gt->Target;
+
+ // Compute full path to object file directory for this target.
+ std::string dir_max;
+ dir_max += gt->Makefile->GetCurrentOutputDirectory();
+ dir_max += "/";
+ dir_max += gt->LocalGenerator->GetTargetDirectory(*target);
+ dir_max += "/";
+ gt->ObjectDirectory = dir_max;
+}
+
+//----------------------------------------------------------------------------
// Private methods
void cmGlobalNinjaGenerator::OpenBuildFileStream()