aboutsummaryrefslogtreecommitdiff
path: root/Arduino.mk
diff options
context:
space:
mode:
authorPieter du Preez <pdupreez@gmail.com>2018-03-18 16:54:39 +0100
committerPieter du Preez <pdupreez@gmail.com>2018-03-18 16:54:39 +0100
commit36b6b233eb161f2e086737116710e7667ad237a1 (patch)
treedca8317adc611502c59ce5028374c8dd83f15db2 /Arduino.mk
parenta7b8084ac6b9b4d94dd91b9b996243432a7de4b3 (diff)
Added the DIAGNOSTICS_COLOR_WHEN var for controlling diagnostics-color.
Some IDEs do not work nicely with the recently added diagnostics-color compiler switch. This patch adds the DIAGNOSTICS_COLOR_WHEN variable, for controlling diagnostics-color switch. The default was chosen to be 'always', which makes the Arduino.mk file backwards compatible with everything up to commit fa82c3a9db (Sat Sep 2 15:32:52 2017 +0100). The supported values for DIAGNOSTICS_COLOR_WHEN are: `always`, `never` and `auto`, and as with all Arduino.mk variables, it can easily be overridden. For more details on the diagnostics-color compiler switch, see: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Language-Independent-Options.html#Language-Independent-Options
Diffstat (limited to 'Arduino.mk')
-rw-r--r--Arduino.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/Arduino.mk b/Arduino.mk
index a238fe6..8ef79c7 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -1108,10 +1108,11 @@ endif
CFLAGS += $(CFLAGS_STD)
CXXFLAGS += -fpermissive -fno-exceptions $(CXXFLAGS_STD)
ASFLAGS += -x assembler-with-cpp
+DIAGNOSTICS_COLOR_WHEN ?= always
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
ASFLAGS += -flto
- CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color
- CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color
+ CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN)
+ CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color=$(DIAGNOSTICS_COLOR_WHEN)
endif
LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL)
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)