summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorMichael Stürmer <michael.stuermer@schaeffler.com>2018-03-19 20:08:38 (GMT)
committerMichael Stürmer <michael.stuermer@schaeffler.com>2018-04-05 04:35:01 (GMT)
commit6c517a9f8d73662f0d3555963d72abcb844585d3 (patch)
tree400d9071e143d839ebc0d344b1f67d45e5371adf /Source/cmGeneratorTarget.cxx
parent3201e4c156fcf79a7c29a73430e72b1bcd43cedc (diff)
downloadCMake-6c517a9f8d73662f0d3555963d72abcb844585d3.zip
CMake-6c517a9f8d73662f0d3555963d72abcb844585d3.tar.gz
CMake-6c517a9f8d73662f0d3555963d72abcb844585d3.tar.bz2
cmGeneratorTarget: add HasLanguage() as wrapper for GetLanguages()
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 63bfbc6..572e7b8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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(
const std::string& config, cmOptionalLinkImplementation& impl) const
{