diff options
author | Brad King <brad.king@kitware.com> | 2017-11-17 19:31:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-17 19:31:07 (GMT) |
commit | 2b7d59f3109483bfa45dc41e2a2f6a2f82addfec (patch) | |
tree | 2bd889fd9381b925fc4609cabec402ac7f7cfac6 /Source/cmGeneratorExpressionNode.cxx | |
parent | 0f6f7c8ab1979b89c4400ebab39532be4bc269fb (diff) | |
download | CMake-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/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 16 |
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( |