An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 6c517a9f authored by Michael Stürmer's avatar Michael Stürmer
Browse files

cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages()

parent 3201e4c1
...@@ -5195,6 +5195,18 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages, ...@@ -5195,6 +5195,18 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
} }
} }
bool cmGeneratorTarget::HasLanguage(std::string const& language,
std::string const& config,
bool exclusive) const
{
std::set<std::string> languages;
this->GetLanguages(languages, config);
// add linker language (if it is different from compiler languages)
languages.insert(this->GetLinkerLanguage(config));
return (languages.size() == 1 || !exclusive) &&
languages.count(language) > 0;
}
void cmGeneratorTarget::ComputeLinkImplementationLanguages( void cmGeneratorTarget::ComputeLinkImplementationLanguages(
const std::string& config, cmOptionalLinkImplementation& impl) const const std::string& config, cmOptionalLinkImplementation& impl) const
{ {
......
...@@ -364,6 +364,12 @@ public: ...@@ -364,6 +364,12 @@ public:
void GetLanguages(std::set<std::string>& languages, void GetLanguages(std::set<std::string>& languages,
std::string const& config) const; std::string const& config) const;
// Evaluate if the target uses the given language for compilation
// and/or linking. If 'exclusive' is true, 'language' is expected
// to be the only language used for the target.
bool HasLanguage(std::string const& language, std::string const& config,
bool exclusive = true) const;
void GetObjectLibrariesCMP0026( void GetObjectLibrariesCMP0026(
std::vector<cmGeneratorTarget*>& objlibs) const; std::vector<cmGeneratorTarget*>& objlibs) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment