server-mode: Fix per-source COMPILE_FLAGS genex evaluation

Logic added by commit 1e4bb358 (Add generator expression support to
per-source COMPILE_FLAGS, 2016-10-25) accidentally frees memory before
finishing with it.  Revise the logic to hold the memory long enough.
This commit is contained in:
Tobias Hunger 2016-12-02 12:21:56 +01:00 committed by Brad King
parent 9a58517df4
commit 5dec0a2328

View File

@ -688,8 +688,9 @@ 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 =
ge.Parse(cflags)->Evaluate(target->GetLocalGenerator(), config);
cge->Evaluate(target->GetLocalGenerator(), config);
lg->AppendFlags(compileFlags, processed);
}
fileData.Flags = compileFlags;