summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2017-12-13 15:34:11 (GMT)
committerMarc Chevrier <marc.chevrier@sap.com>2017-12-13 15:35:22 (GMT)
commit10f58b27ac1015e4f1615372bb5168e43afcdf3a (patch)
tree8f1db98fd525f9a4039fd9a0194b009d208a4acc /Source/cmGeneratorExpression.cxx
parent14fe6d431b12139ea2aeb5bcc09efd0f964597aa (diff)
downloadCMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.zip
CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.gz
CMake-10f58b27ac1015e4f1615372bb5168e43afcdf3a.tar.bz2
Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r--Source/cmGeneratorExpression.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 86991c1..6979b38 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -9,6 +9,7 @@
#include "assert.h"
#include "cmAlgorithms.h"
#include "cmGeneratorExpressionContext.h"
+#include "cmGeneratorExpressionDAGChecker.h"
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorExpressionLexer.h"
#include "cmGeneratorExpressionParser.h"
@@ -385,3 +386,18 @@ void cmCompiledGeneratorExpression::GetMaxLanguageStandard(
mapping = it->second;
}
}
+
+const char* cmGeneratorExpressionInterpreter::Evaluate(
+ const char* expression, const std::string& property)
+{
+ if (this->Target.empty()) {
+ return this->EvaluateExpression(expression);
+ }
+
+ // Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this->Target, property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property,
+ nullptr, nullptr);
+
+ return this->EvaluateExpression(expression, &dagChecker);
+}