diff options
author | Henry Schreiner <hschrein@cern.ch> | 2018-05-02 21:51:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-05-03 12:34:39 (GMT) |
commit | 4f82199befee194aa924fd4dcdb2f4aad1f7dab6 (patch) | |
tree | 9af74a279353efc6ff4feadaebd6f4d04c7d1006 /Source/cmGeneratorExpressionNode.cxx | |
parent | 5e455ac120fd596a0ad1a4216c5734bb52ac1b75 (diff) | |
download | CMake-4f82199befee194aa924fd4dcdb2f4aad1f7dab6.zip CMake-4f82199befee194aa924fd4dcdb2f4aad1f7dab6.tar.gz CMake-4f82199befee194aa924fd4dcdb2f4aad1f7dab6.tar.bz2 |
Genex: Allow COMPILE_LANGUAGE to name a language that is not loaded
Evaluate to false on `$<COMPILE_LANGUAGE:Lang>` if language `Lang`
is not loaded. This is helpful in exported targets consumed in other
projects that may not enable all the same languages.
Fixes: #17952
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 399e894..7b35bce 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1013,16 +1013,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode return std::string(); } - std::vector<std::string> enabledLanguages; cmGlobalGenerator* gg = context->LG->GetGlobalGenerator(); - gg->GetEnabledLanguages(enabledLanguages); - if (!parameters.empty() && - std::find(enabledLanguages.begin(), enabledLanguages.end(), - parameters.front()) == enabledLanguages.end()) { - reportError(context, content->GetOriginalExpression(), - "$<COMPILE_LANGUAGE:...> Unknown language."); - return std::string(); - } std::string genName = gg->GetName(); if (genName.find("Makefiles") == std::string::npos && genName.find("Ninja") == std::string::npos && |