diff options
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() |