summaryrefslogtreecommitdiffstats
path: root/Source/cmServerProtocol.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2017-12-01 16:10:45 (GMT)
committerBrad King <brad.king@kitware.com>2017-12-04 14:10:09 (GMT)
commit6bffc13ef1c85ec565273d25e811fd6c326533f0 (patch)
tree752484518da79d7edfe4ba98880f1ce7d694478c /Source/cmServerProtocol.cxx
parenta4faf8638744edf7e3dd8931b55ba87e8f7738be (diff)
downloadCMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.zip
CMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.tar.gz
CMake-6bffc13ef1c85ec565273d25e811fd6c326533f0.tar.bz2
Refactor per-source generator expression evaluation
Prepare to add generator expression support to more source properties. Factor out some duplicated code into a helper to avoid further duplication.
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r--Source/cmServerProtocol.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index cfac513..1bb07e7 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -692,6 +692,8 @@ static Json::Value DumpSourceFilesList(
std::vector<cmSourceFile*> files;
target->GetSourceFiles(files, config);
+ cmGeneratorExpressionInterpreter genexInterpreter(
+ target->GetLocalGenerator(), target, config);
std::unordered_map<LanguageData, std::vector<std::string>> fileGroups;
for (cmSourceFile* file : files) {
@@ -703,11 +705,7 @@ static Json::Value DumpSourceFilesList(
std::string compileFlags = ld.Flags;
if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) {
- cmGeneratorExpression ge;
- auto cge = ge.Parse(cflags);
- const char* processed =
- cge->Evaluate(target->GetLocalGenerator(), config);
- lg->AppendFlags(compileFlags, processed);
+ lg->AppendFlags(compileFlags, genexInterpreter.Evaluate(cflags));
}
fileData.Flags = compileFlags;