From bbf8fea7388dfd3091d241afc5bdec5804d5345e Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 6 Oct 2021 19:03:58 -0300 Subject: [PATCH] A more accurate GCC compiler detection Instead of relying on the executable name, it is better to "parse" the version information of the compiler. --- makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index f17e7bbb..9e068183 100644 --- a/makefile +++ b/makefile @@ -36,7 +36,10 @@ single-c: # compiler setup CC = clang -ifneq ($(findstring gcc, $(CC)),) + +# Detects if we are running GCC instead of Clang +CC_IS_GCC = $(shell $(CC) --version | head -n1 | grep -m 1 -c "gcc") +ifeq (${CC_IS_GCC}, 1) CCFLAGS = -Wno-parentheses else CCFLAGS = -Wno-microsoft-anon-tag @@ -121,4 +124,4 @@ ${bd}/load.o: src/gen/customRuntime clean: rm -f ${bd}/*.o - rm -f ${bd}/*.d \ No newline at end of file + rm -f ${bd}/*.d