diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-03-12 20:09:20 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-03-13 14:27:23 (GMT) |
commit | cd43433de56ab31269a076fb2b2ace8babaa107d (patch) | |
tree | 3cfc978af258b7b0fc0b046b3d99be1b4cd01254 /Source/cmGlobalNinjaGenerator.cxx | |
parent | d5b2e33be2119ad12744ed62920a8f8d9b6d705d (diff) | |
download | CMake-cd43433de56ab31269a076fb2b2ace8babaa107d.zip CMake-cd43433de56ab31269a076fb2b2ace8babaa107d.tar.gz CMake-cd43433de56ab31269a076fb2b2ace8babaa107d.tar.bz2 |
cmGlobalGenerator: Extract a ComputeTargetObjectDirectory interface.
Make it public for future external calls.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 0a05f5a..686414d 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() |