diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 27 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 5 |
2 files changed, 23 insertions, 9 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 333ed07..29d2af3 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8052,21 +8052,30 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages, objectLibraries.insert(gt); } } else { - std::vector<cmSourceFile const*> externalObjects; - this->GetExternalObjects(externalObjects, config); - for (cmSourceFile const* extObj : externalObjects) { - std::string objLib = extObj->GetObjectLibrary(); - if (cmGeneratorTarget* tgt = - this->LocalGenerator->FindGeneratorTargetToUse(objLib)) { - objectLibraries.insert(tgt); - } - } + objectLibraries = this->GetSourceObjectLibraries(config); } for (cmGeneratorTarget const* objLib : objectLibraries) { objLib->GetLanguages(languages, config); } } +std::set<cmGeneratorTarget const*> cmGeneratorTarget::GetSourceObjectLibraries( + std::string const& config) const +{ + std::set<cmGeneratorTarget const*> objectLibraries; + std::vector<cmSourceFile const*> externalObjects; + this->GetExternalObjects(externalObjects, config); + for (cmSourceFile const* extObj : externalObjects) { + std::string objLib = extObj->GetObjectLibrary(); + if (cmGeneratorTarget* tgt = + this->LocalGenerator->FindGeneratorTargetToUse(objLib)) { + objectLibraries.insert(tgt); + } + } + + return objectLibraries; +} + bool cmGeneratorTarget::IsLanguageUsed(std::string const& language, std::string const& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index bf49914..2a301e3 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -463,6 +463,11 @@ public: bool IsLanguageUsed(std::string const& language, std::string const& config) const; + // Get the set of targets directly referenced via `TARGET_OBJECTS` in the + // source list for a configuration. + std::set<cmGeneratorTarget const*> GetSourceObjectLibraries( + std::string const& config) const; + bool IsCSharpOnly() const; bool IsDotNetSdkTarget() const; |