diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9dc045ca04..22b1baf355 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4410,11 +4410,25 @@ cmGeneratorTarget::GetLinkImplementation(const std::string& config) const if(!impl.LanguagesDone) { impl.LanguagesDone = true; - this->Target->ComputeLinkImplementationLanguages(config, impl); + this->ComputeLinkImplementationLanguages(config, impl); } return &impl; } +//---------------------------------------------------------------------------- +void cmGeneratorTarget::ComputeLinkImplementationLanguages( + const std::string& config, + cmOptionalLinkImplementation& impl) const +{ + // This target needs runtime libraries for its source languages. + std::set languages; + // Get languages used in our source files. + this->Target->GetLanguages(languages, config); + // Copy the set of langauges to the link implementation. + impl.Languages.insert(impl.Languages.begin(), + languages.begin(), languages.end()); +} + //---------------------------------------------------------------------------- bool cmGeneratorTarget::HaveBuildTreeRPATH(const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 99463c79b1..f5dc20d9d9 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -201,6 +201,10 @@ public: cmLinkImplementation const* GetLinkImplementation(const std::string& config) const; + void ComputeLinkImplementationLanguages(const std::string& config, + cmOptionalLinkImplementation& impl + ) const; + bool HaveBuildTreeRPATH(const std::string& config) const; /** Full path with trailing slash to the top-level directory diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9073f8276f..f395c452e4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3704,20 +3704,6 @@ void cmTarget::ComputeLinkImplementationLibraries( } } -//---------------------------------------------------------------------------- -void cmTarget::ComputeLinkImplementationLanguages( - const std::string& config, - cmOptionalLinkImplementation& impl) const -{ - // This target needs runtime libraries for its source languages. - std::set languages; - // Get languages used in our source files. - this->GetLanguages(languages, config); - // Copy the set of langauges to the link implementation. - impl.Languages.insert(impl.Languages.begin(), - languages.begin(), languages.end()); -} - //---------------------------------------------------------------------------- cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 8866e65c4e..1db4ba1af8 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -237,9 +237,6 @@ public: void ComputeLinkImplementationLibraries(const std::string& config, cmOptionalLinkImplementation& impl, cmTarget const* head) const; - void ComputeLinkImplementationLanguages(const std::string& config, - cmOptionalLinkImplementation& impl - ) const; cmOptionalLinkImplementation& GetLinkImplMap(std::string const& config) const;