From 12adaf5cb93231af5721c7a17535533f53f2b4ea Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 2 Oct 2015 15:17:47 -0700 Subject: [PATCH] Fix gcc color diagnostics gcc color diagnostics stopped working when the flag was moved to TARGET_GLOBAL_CFLAGS, as that gets overwritten by combo/select.mk. Put it back in COMMON_GLOBAL_CFLAGS, and then let the windows build filter it out, similar to the way clang deals with unknown flags. Change-Id: I2db221edb893d81f199494e7515d1b9282c12fae --- core/combo/HOST_CROSS_windows-x86.mk | 3 +++ core/config.mk | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/combo/HOST_CROSS_windows-x86.mk b/core/combo/HOST_CROSS_windows-x86.mk index f5095949d8..c5a713cfe1 100644 --- a/core/combo/HOST_CROSS_windows-x86.mk +++ b/core/combo/HOST_CROSS_windows-x86.mk @@ -53,3 +53,6 @@ $(combo_var_prefix)SHLIB_SUFFIX := .dll $(combo_var_prefix)EXECUTABLE_SUFFIX := .exe $(combo_var_prefix)IS_64_BIT := + +# The mingw gcc is 4.8, 4.9 is required for color diagnostics +$(combo_var_prefix)UNKNOWN_CFLAGS := -fdiagnostics-color diff --git a/core/config.mk b/core/config.mk index 0b1c020914..5cde8eb701 100644 --- a/core/config.mk +++ b/core/config.mk @@ -122,10 +122,7 @@ COMMON_RELEASE_CFLAGS:= -DNDEBUG -UDEBUG # Force gcc to always output color diagnostics. Ninja will strip the ANSI # color codes if it is not running in a terminal. -# Use host and target GLOBAL_CFLAGS so it doesn't apply to HOST_CROSS, the windows -# toolchain is still 4.8 and doesn't support color. -HOST_GLOBAL_CFLAGS += -fdiagnostics-color -TARGET_GLOBAL_CFLAGS += -fdiagnostics-color +COMMON_GLOBAL_CFLAGS += -fdiagnostics-color COMMON_GLOBAL_CPPFLAGS:= -Wsign-promo COMMON_RELEASE_CPPFLAGS:= @@ -625,7 +622,7 @@ $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS += $($(HOST_2ND_ARCH_VAR_PREFIX) endif ifdef HOST_CROSS_OS -HOST_CROSS_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS) +HOST_CROSS_GLOBAL_CFLAGS += $(filter-out $(HOST_CROSS_UNKNOWN_CFLAGS),$(COMMON_GLOBAL_CFLAGS)) HOST_CROSS_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS) HOST_CROSS_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS) HOST_CROSS_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)