diff options
author | Brad King <brad.king@kitware.com> | 2014-11-10 10:42:59 -0500 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-10 10:42:59 -0500 |
commit | ee6c79d1a34fba29d321ff00b19e79bda472c0d7 (patch) | |
tree | 060c42132c5f2fffb6ab8e050f8d56224bd27193 /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | f62e476990df9814b6be61a231b6b4e3ff140547 (diff) | |
parent | caa4b7b88b3845a23d0767b9e63ee6e31ca614e5 (diff) | |
download | cmake-ee6c79d1a34fba29d321ff00b19e79bda472c0d7.tar.gz |
Merge topic 'genex-target-objects-ordering'
caa4b7b8 genex: Preserve order while evaluating TARGET_OBJECTS
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 0010dbafe5..27fe9102b5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1286,12 +1286,16 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode std::string obj_dir = gt->ObjectDirectory; std::string result; const char* sep = ""; - for(std::map<cmSourceFile const*, std::string>::const_iterator it - = mapping.begin(); it != mapping.end(); ++it) + for(std::vector<cmSourceFile const*>::const_iterator it + = objectSources.begin(); it != objectSources.end(); ++it) { - assert(!it->second.empty()); + // Find the object file name corresponding to this source file. + std::map<cmSourceFile const*, std::string>::const_iterator + map_it = mapping.find(*it); + // It must exist because we populated the mapping just above. + assert(!map_it->second.empty()); result += sep; - std::string objFile = obj_dir + it->second; + std::string objFile = obj_dir + map_it->second; cmSourceFile* sf = context->Makefile->GetOrCreateSource(objFile, true); sf->SetObjectLibrary(tgtName); sf->SetProperty("EXTERNAL_OBJECT", "1"); |