From 0431f2c4d7cbfcd873bc34caee9ed09253e8c8ad Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Aug 2015 17:37:50 +0200 Subject: cmGeneratorTarget: Move ComputeLinkImplementationLanguages from cmTarget. --- Source/cmGeneratorTarget.cxx | 16 +++++++++++++++- Source/cmGeneratorTarget.h | 4 ++++ Source/cmTarget.cxx | 14 -------------- Source/cmTarget.h | 3 --- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9dc045c..22b1baf 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -4410,12 +4410,26 @@ 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 { if (this->Target->GetPropertyAsBool("SKIP_BUILD_RPATH")) diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 99463c7..f5dc20d 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 9073f82..f395c45 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3705,20 +3705,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 { cmTarget const* tgt = this->Makefile->FindTargetToUse(name); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 8866e65..1db4ba1 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; -- cgit v0.12