summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-11 16:37:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-13 14:28:02 (GMT)
commitf6da044080d854b9ad87cef5c2a6f5195722a6da (patch)
tree9272911eaf9625896c75a8ccf0ad52560b0e6f48 /Source/cmGlobalNinjaGenerator.cxx
parent9ad804ac7be18efb92040434808f89174586b13d (diff)
downloadCMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.zip
CMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.tar.gz
CMake-f6da044080d854b9ad87cef5c2a6f5195722a6da.tar.bz2
cmLocalGenerator: Add ComputeObjectFilenames interface.
Implement it in the local generators and use it in the global generators.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index e9c31e9..08507eb 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -19,6 +19,7 @@
#include "cmVersion.h"
#include <algorithm>
+#include <assert.h>
const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja";
const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja";
@@ -636,15 +637,21 @@ void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
{
std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources);
- // Compute the name of each object file.
- for(std::vector<cmSourceFile const*>::iterator
- si = objectSources.begin();
- si != objectSources.end(); ++si)
+
+ std::map<cmSourceFile const*, std::string> mapping;
+ for(std::vector<cmSourceFile const*>::const_iterator it
+ = objectSources.begin(); it != objectSources.end(); ++it)
+ {
+ mapping[*it];
+ }
+
+ gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
+
+ for(std::map<cmSourceFile const*, std::string>::const_iterator it
+ = mapping.begin(); it != mapping.end(); ++it)
{
- cmSourceFile const* sf = *si;
- std::string objectName = gt->LocalGenerator
- ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
- gt->AddObject(sf, objectName);
+ assert(!it->second.empty());
+ gt->AddObject(it->first, it->second);
}
}