summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2017-12-15 11:31:53 (GMT)
committerMarc Chevrier <marc.chevrier@sap.com>2018-01-23 09:24:56 (GMT)
commit78b1c2e09ee5005d75e31c68c1c7b112e4b36d90 (patch)
tree3df5dc8f66711170a2cd8e0da75adeb7b79102b9 /Source/cmMakefileTargetGenerator.cxx
parent3f935e690a337a7a692c30d4d14082e08d1bed7c (diff)
downloadCMake-78b1c2e09ee5005d75e31c68c1c7b112e4b36d90.zip
CMake-78b1c2e09ee5005d75e31c68c1c7b112e4b36d90.tar.gz
CMake-78b1c2e09ee5005d75e31c68c1c7b112e4b36d90.tar.bz2
sourceFile properties: add property COMPILE_OPTIONS
Add the support of per-source property COMPILE_OPTIONS, including generator expressions support. Related: #17507
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 002cc0f..bee0168 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -445,6 +445,16 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
<< "\n";
}
+ const std::string COMPILE_OPTIONS("COMPILE_OPTIONS");
+ if (const char* coptions = source.GetProperty(COMPILE_OPTIONS)) {
+ const char* evaluatedOptions =
+ genexInterpreter.Evaluate(coptions, COMPILE_OPTIONS);
+ this->LocalGenerator->AppendCompileOptions(flags, evaluatedOptions);
+ *this->FlagFileStream << "# Custom options: " << relativeObj
+ << "_OPTIONS = " << evaluatedOptions << "\n"
+ << "\n";
+ }
+
// Add language-specific defines.
std::set<std::string> defines;