summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2019-09-03 17:25:44 (GMT)
committerBrad King <brad.king@kitware.com>2019-09-09 13:43:34 (GMT)
commitb13207910e848d3c980e4b3dc176e113a3c04bbc (patch)
tree5fce1a7bc0cf1d674ff225aa52f9d11d82833041
parentca7b90dcf2fc6ef5345de162ec2532454376fe2f (diff)
downloadCMake-b13207910e848d3c980e4b3dc176e113a3c04bbc.zip
CMake-b13207910e848d3c980e4b3dc176e113a3c04bbc.tar.gz
CMake-b13207910e848d3c980e4b3dc176e113a3c04bbc.tar.bz2
cmLocalGenerator: Clarify AddCompileOptions filter logic
-rw-r--r--Source/cmLocalGenerator.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 69866c4..042c108 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -838,14 +838,17 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
if (const char* langFlagRegexStr =
this->Makefile->GetDefinition(langFlagRegexVar)) {
// Filter flags acceptable to this language.
- std::vector<std::string> opts;
if (const char* targetFlags = target->GetProperty("COMPILE_FLAGS")) {
+ std::vector<std::string> opts;
cmSystemTools::ParseWindowsCommandLine(targetFlags, opts);
+ // Re-escape these flags since COMPILE_FLAGS were already parsed
+ // as a command line above.
+ this->AppendCompileOptions(flags, opts, langFlagRegexStr);
}
- target->GetCompileOptions(opts, config, lang);
- // (Re-)Escape these flags. COMPILE_FLAGS were already parsed
- // as a command line above, and COMPILE_OPTIONS are escaped.
- this->AppendCompileOptions(flags, opts, langFlagRegexStr);
+ std::vector<std::string> targetCompileOpts;
+ target->GetCompileOptions(targetCompileOpts, config, lang);
+ // COMPILE_OPTIONS are escaped.
+ this->AppendCompileOptions(flags, targetCompileOpts, langFlagRegexStr);
} else {
// Use all flags.
if (const char* targetFlags = target->GetProperty("COMPILE_FLAGS")) {