diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8efd7bb52..2a144c6b2 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -310,10 +310,6 @@ cmGeneratorTarget ::GetObjectSources(std::vector &data) const { IMPLEMENT_VISIT(ObjectSources); - if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY) - { - this->ObjectSources = data; - } } //---------------------------------------------------------------------------- @@ -577,9 +573,11 @@ cmGeneratorTarget::UseObjectLibraries(std::vector& objs) const cmTarget* objLib = *ti; cmGeneratorTarget* ogt = this->GlobalGenerator->GetGeneratorTarget(objLib); + std::vector objectSources; + ogt->GetObjectSources(objectSources); for(std::vector::const_iterator - si = ogt->ObjectSources.begin(); - si != ogt->ObjectSources.end(); ++si) + si = objectSources.begin(); + si != objectSources.end(); ++si) { std::string obj = ogt->ObjectDirectory; obj += ogt->Objects[*si]; diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 139e736c8..53e27c510 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -127,7 +127,6 @@ private: std::map Objects; std::set ExplicitObjectName; - mutable std::vector ObjectSources; std::vector ObjectLibraries; mutable std::map > SystemIncludesCache;