makefile: Make gcc and clang warnings fail builds on compile warnings

This change allows CI builds to fail without detailed viewing of build output
for gcc and clang builds (all modern compilers).  Thus forcing PR submitters
to find these problems before PRs are merged.  This is done  by compiling
with -Werror for these compilers.

We don't know how to do this for other compilers which may be able to use
the makefile, so warnings there will still proceed to build successfully.
This commit is contained in:
Mark Pizzolato 2022-10-25 16:41:54 -10:00 committed by Paul Koning
parent e6106d1ebf
commit cfc59c517f

View file

@ -257,6 +257,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
endif endif
endif endif
else else
OS_CCDEFS += -Werror
ifeq (,$(findstring ++,${GCC})) ifeq (,$(findstring ++,${GCC}))
CC_STD = -std=gnu99 CC_STD = -std=gnu99
else else
@ -264,6 +265,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin)
endif endif
endif endif
else else
OS_CCDEFS += -Werror
ifeq (Apple,$(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 }')) ifeq (Apple,$(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 }'))
COMPILER_NAME = $(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }') COMPILER_NAME = $(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }')
CLANG_VERSION = $(word 4,$(COMPILER_NAME)) CLANG_VERSION = $(word 4,$(COMPILER_NAME))