summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-05 13:15:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-12-05 13:15:40 (GMT)
commit729dda542010ed584d08630d2e5ab1ff3129e5e8 (patch)
tree35d7dfbbe0608c7546b6d1a539186f8d72f02371 /Source/cmVisualStudio10TargetGenerator.cxx
parent0236e5080229e5ce05c43077a56dc5b58fc644fd (diff)
parent6bffc13ef1c85ec565273d25e811fd6c326533f0 (diff)
downloadCMake-729dda542010ed584d08630d2e5ab1ff3129e5e8.zip
CMake-729dda542010ed584d08630d2e5ab1ff3129e5e8.tar.gz
CMake-729dda542010ed584d08630d2e5ab1ff3129e5e8.tar.bz2
Merge topic 'src-genex-refactoring'
6bffc13e Refactor per-source generator expression evaluation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1550
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d2f21cd..badd24f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2067,10 +2067,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
bool configDependentFlags = false;
std::string defines;
if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) {
-
- if (cmGeneratorExpression::Find(cflags) != std::string::npos) {
- configDependentFlags = true;
- }
+ configDependentFlags =
+ cmGeneratorExpression::Find(cflags) != std::string::npos;
flags += cflags;
}
if (const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) {
@@ -2127,8 +2125,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
// if we have flags or defines for this config then
// use them
- if (!flags.empty() || configDependentFlags || !configDefines.empty() ||
- compileAs || noWinRT) {
+ if (!flags.empty() || !configDefines.empty() || compileAs || noWinRT) {
(*this->BuildFileStream) << firstString;
firstString = ""; // only do firstString once
hasFlags = true;
@@ -2149,6 +2146,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
} else if (srclang == "CSharp") {
flagtable = gg->GetCSharpFlagTable();
}
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ this->LocalGenerator, this->GeneratorTarget, *config);
cmVisualStudioGeneratorOptions clOptions(
this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler,
flagtable, 0, this);
@@ -2159,11 +2158,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
clOptions.AddFlag("CompileAsWinRT", "false");
}
if (configDependentFlags) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(flags);
- std::string evaluatedFlags = cge->Evaluate(
- this->LocalGenerator, *config, false, this->GeneratorTarget);
- clOptions.Parse(evaluatedFlags.c_str());
+ clOptions.Parse(genexInterpreter.Evaluate(flags));
} else {
clOptions.Parse(flags.c_str());
}