summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx31
1 files changed, 25 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 64ca863..321dd42 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -311,18 +311,36 @@ cmGeneratorTarget
::GetObjectSources(std::vector<cmSourceFile const*> &data) const
{
IMPLEMENT_VISIT(ObjectSources);
+
+ if (!this->Objects.empty())
+ {
+ return;
+ }
+
+ for(std::vector<cmSourceFile const*>::const_iterator it = data.begin();
+ it != data.end(); ++it)
+ {
+ this->Objects[*it];
+ }
+
+ this->LocalGenerator->ComputeObjectFilenames(this->Objects, this);
}
-//----------------------------------------------------------------------------
-const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
+void cmGeneratorTarget::ComputeObjectMapping()
{
- return this->Objects[file];
+ if(!this->Objects.empty())
+ {
+ return;
+ }
+ std::vector<cmSourceFile const*> sourceFiles;
+ this->GetObjectSources(sourceFiles);
}
-void cmGeneratorTarget::AddObject(cmSourceFile const* sf,
- std::string const&name)
+//----------------------------------------------------------------------------
+const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
{
- this->Objects[sf] = name;
+ this->ComputeObjectMapping();
+ return this->Objects[file];
}
//----------------------------------------------------------------------------
@@ -334,6 +352,7 @@ void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
//----------------------------------------------------------------------------
bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
{
+ const_cast<cmGeneratorTarget*>(this)->ComputeObjectMapping();
std::set<cmSourceFile const*>::const_iterator it
= this->ExplicitObjectName.find(file);
return it != this->ExplicitObjectName.end();