summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-12-02 11:21:56 (GMT)
committerBrad King <brad.king@kitware.com>2016-12-02 15:15:50 (GMT)
commit5dec0a232843d6408ed1a73292126c47a85bd5af (patch)
tree9ad34c4672c09efaa853a7172dd3fe2bae9f5c91
parent9a58517df4168a5d928b715fcaa96fc24df9b40c (diff)
downloadCMake-5dec0a232843d6408ed1a73292126c47a85bd5af.zip
CMake-5dec0a232843d6408ed1a73292126c47a85bd5af.tar.gz
CMake-5dec0a232843d6408ed1a73292126c47a85bd5af.tar.bz2
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.
-rw-r--r--Source/cmServerProtocol.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 00dc0b5..e899190 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -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;