diff options
author | Zsolt Parragi <zsolt.parragi@cancellar.hu> | 2016-10-25 16:23:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-28 15:18:03 (GMT) |
commit | 1e4bb358946a100ea04bbc97f8195b90b44a5e9c (patch) | |
tree | ec0cebb25ef0f6fcc0d68ab8548e0d2a1f004ab3 /Source/cmServerProtocol.cxx | |
parent | ee0f2d23fcf3cd7a67ad8d7bd132a475ed78405f (diff) | |
download | CMake-1e4bb358946a100ea04bbc97f8195b90b44a5e9c.zip CMake-1e4bb358946a100ea04bbc97f8195b90b44a5e9c.tar.gz CMake-1e4bb358946a100ea04bbc97f8195b90b44a5e9c.tar.bz2 |
Add generator expression support to per-source COMPILE_FLAGS
This allows users to specify different genex-based compile flags for
each file in a target, e.g. compiling just a single file with `Od/Ox` in
release builds on Visual Studio.
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 857ce39..00dc0b5 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -686,7 +686,12 @@ static Json::Value DumpSourceFilesList( cmLocalGenerator* lg = target->GetLocalGenerator(); std::string compileFlags = ld.Flags; - lg->AppendFlags(compileFlags, file->GetProperty("COMPILE_FLAGS")); + if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) { + cmGeneratorExpression ge; + const char* processed = + ge.Parse(cflags)->Evaluate(target->GetLocalGenerator(), config); + lg->AppendFlags(compileFlags, processed); + } fileData.Flags = compileFlags; fileData.IncludePathList = ld.IncludePathList; |