|
|
@@ -1609,6 +1609,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetTargetCompileFlags(
|
|
|
|
|
|
this->AddCMP0018Flags(compileFlags, target, lang, config);
|
|
|
this->AddVisibilityPresetFlags(compileFlags, target, lang);
|
|
|
+ this->AddColorDiagnosticsFlags(compileFlags, lang);
|
|
|
this->AppendFlags(compileFlags, mf->GetDefineFlags());
|
|
|
this->AppendFlags(compileFlags,
|
|
|
this->GetFrameworkFlags(lang, config, target));
|
|
|
@@ -2354,6 +2355,29 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void cmLocalGenerator::AddColorDiagnosticsFlags(std::string& flags,
|
|
|
+ const std::string& lang)
|
|
|
+{
|
|
|
+ cmValue diag = this->Makefile->GetDefinition("CMAKE_COLOR_DIAGNOSTICS");
|
|
|
+ if (diag.IsSet()) {
|
|
|
+ std::string colorFlagName;
|
|
|
+ if (diag.IsOn()) {
|
|
|
+ colorFlagName =
|
|
|
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_COLOR_DIAGNOSTICS");
|
|
|
+ } else {
|
|
|
+ colorFlagName =
|
|
|
+ cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_COLOR_DIAGNOSTICS_OFF");
|
|
|
+ }
|
|
|
+
|
|
|
+ std::vector<std::string> options;
|
|
|
+ this->Makefile->GetDefExpandList(colorFlagName, options);
|
|
|
+
|
|
|
+ for (std::string const& option : options) {
|
|
|
+ this->AppendFlagEscape(flags, option);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
|
|
|
const std::string& var,
|
|
|
const std::string& config)
|