diff options
author | Brad King <brad.king@kitware.com> | 2017-04-11 18:42:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-18 13:03:32 (GMT) |
commit | 930042f2d95e83047231457f4d9134c74b8744fc (patch) | |
tree | cd43b9afbde99909cdbacba853dd49384699d999 /Source/cmGeneratorTarget.cxx | |
parent | 3ab4681efa6db7339af36218fffea165ad1186f3 (diff) | |
download | CMake-930042f2d95e83047231457f4d9134c74b8744fc.zip CMake-930042f2d95e83047231457f4d9134c74b8744fc.tar.gz CMake-930042f2d95e83047231457f4d9134c74b8744fc.tar.bz2 |
cmGeneratorTarget: Factor out a GetTargetObjectNames method
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 35b2603..4ce1eca 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3254,6 +3254,33 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const return prefix + base + ".pdb"; } +void cmGeneratorTarget::GetTargetObjectNames( + std::string const& config, std::vector<std::string>& objects) const +{ + std::vector<cmSourceFile const*> objectSources; + this->GetObjectSources(objectSources, config); + std::map<cmSourceFile const*, std::string> mapping; + + for (std::vector<cmSourceFile const*>::const_iterator it = + objectSources.begin(); + it != objectSources.end(); ++it) { + mapping[*it]; + } + + this->LocalGenerator->ComputeObjectFilenames(mapping, this); + + for (std::vector<cmSourceFile const*>::const_iterator it = + objectSources.begin(); + it != objectSources.end(); ++it) { + // 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()); + objects.push_back(map_it->second); + } +} + bool cmGeneratorTarget::StrictTargetComparison::operator()( cmGeneratorTarget const* t1, cmGeneratorTarget const* t2) const { |