summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraSublimeTextGenerator.cxx
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2016-10-25 16:23:22 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-28 15:18:03 (GMT)
commit1e4bb358946a100ea04bbc97f8195b90b44a5e9c (patch)
treeec0cebb25ef0f6fcc0d68ab8548e0d2a1f004ab3 /Source/cmExtraSublimeTextGenerator.cxx
parentee0f2d23fcf3cd7a67ad8d7bd132a475ed78405f (diff)
downloadCMake-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/cmExtraSublimeTextGenerator.cxx')
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index f46019e..0480d10 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -341,7 +341,11 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
}
// Add source file specific flags.
- lg->AppendFlags(flags, source->GetProperty("COMPILE_FLAGS"));
+ if (const char* cflags = source->GetProperty("COMPILE_FLAGS")) {
+ cmGeneratorExpression ge;
+ const char* processed = ge.Parse(cflags)->Evaluate(lg, config);
+ lg->AppendFlags(flags, processed);
+ }
return flags;
}