cmGeneratorTarget: Move ComputeLinkImplementationLanguages from cmTarget.

This commit is contained in:
Stephen Kelly 2015-08-05 17:37:50 +02:00
parent abe9505df9
commit 0431f2c4d7
4 changed files with 19 additions and 18 deletions

View File

@ -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<std::string> 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
{

View File

@ -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

View File

@ -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<std::string> 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
{

View File

@ -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;