Introduces an option to treat compiler warnings as errors. The build
system stops compilation if a compiler warning is displayed. This
option is intended to ensure clean builds.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Alexander Jung <alex@unikraft.org>
Approved-by: Razvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #222
comment "Hint: Keep frame pointers to ease debugging"
depends on !OPTIMIZE_NOOMITFP && !DEBUG_SYMBOLS_LVL0
+config OPTIMIZE_WARNISERROR
+ bool "Treat warnings as errors"
+ default n
+ help
+ When this option is enabled, the build system stops
+ compilation when a compiler warning is displayed.
+
config OPTIMIZE_SYMFILE
bool "Create a symbols file"
default n
LIBLDFLAGS-$(CONFIG_OPTIMIZE_LTO) += $(COMPFLAGS) $(COMPFLAGS-y) $(ARCHFLAGS) $(ARCHFLAGS-y)
LDFLAGS-$(CONFIG_OPTIMIZE_LTO) += $(COMPFLAGS) $(COMPFLAGS-y) $(ARCHFLAGS) $(ARCHFLAGS-y)
+COMPFLAGS-$(CONFIG_OPTIMIZE_WARNISERROR) += -Werror
+
DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL0) += -g0
DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1) += -g1
DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2) += -g2