summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-17 19:31:07 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-17 19:31:07 (GMT)
commit2b7d59f3109483bfa45dc41e2a2f6a2f82addfec (patch)
tree2bd889fd9381b925fc4609cabec402ac7f7cfac6 /Source
parent0f6f7c8ab1979b89c4400ebab39532be4bc269fb (diff)
downloadCMake-2b7d59f3109483bfa45dc41e2a2f6a2f82addfec.zip
CMake-2b7d59f3109483bfa45dc41e2a2f6a2f82addfec.tar.gz
CMake-2b7d59f3109483bfa45dc41e2a2f6a2f82addfec.tar.bz2
Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
Issue: #17435
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 488bbfd..5068560 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -828,12 +828,16 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
}
std::string genName = gg->GetName();
if (genName.find("Visual Studio") != std::string::npos) {
- reportError(context, content->GetOriginalExpression(),
- "$<COMPILE_LANGUAGE:...> may not be used with Visual Studio "
- "generators.");
- return std::string();
- }
- if (genName.find("Xcode") != std::string::npos) {
+ if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
+ dagChecker->EvaluatingCompileOptions() ||
+ dagChecker->EvaluatingIncludeDirectories())) {
+ reportError(
+ context, content->GetOriginalExpression(),
+ "$<COMPILE_LANGUAGE:...> may only be used for file(GENERATE) "
+ "with the Visual Studio generator.");
+ return std::string();
+ }
+ } else if (genName.find("Xcode") != std::string::npos) {
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
dagChecker->EvaluatingIncludeDirectories())) {
reportError(