Makefile.in: Introduce SUPPRESS_WARNINGS for quieter CI build.

Due to how we handle building and compilation flags we end up with a lot
of warnings that are normally hidden. Let's introudce an option to
suppress them for CI builds to generate smaller, more searchable logs.
This commit is contained in:
Arkadiusz Hiler 2023-07-05 14:32:24 +03:00
parent 37cf4d2086
commit 7c21be5c27
2 changed files with 7 additions and 2 deletions

View file

@ -7,6 +7,7 @@ OBJ := $(abspath $(CURDIR))
ifeq ($(filter s,$(MAKEFLAGS)),s) ifeq ($(filter s,$(MAKEFLAGS)),s)
MAKEFLAGS += --quiet --no-print-directory MAKEFLAGS += --quiet --no-print-directory
--quiet? := --quiet --quiet? := --quiet
CARGO_BUILD_ARGS := --quiet
else else
MFLAGS += V=1 VERBOSE=1 MFLAGS += V=1 VERBOSE=1
-v? := -v -v? := -v
@ -56,7 +57,11 @@ DEBUG_FLAGS := -ggdb -ffunction-sections -fdata-sections -fno-omit-frame-poin
COMMON_FLAGS = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS) $(SANITY_FLAGS) -ffile-prefix-map=$(CCACHE_BASEDIR)=. COMMON_FLAGS = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS) $(SANITY_FLAGS) -ffile-prefix-map=$(CCACHE_BASEDIR)=.
COMMON_FLAGS32 := -mstackrealign COMMON_FLAGS32 := -mstackrealign
COMMON_FLAGS64 := -mcmodel=small COMMON_FLAGS64 := -mcmodel=small
CARGO_BUILD_ARG := --release CARGO_BUILD_ARGS += --release
ifneq ($(SUPPRESS_WARNINGS),)
COMMON_FLAGS += -w
endif
$(DST_DIR): $(DST_DIR):
mkdir -p $@ mkdir -p $@

View file

@ -17,7 +17,7 @@ $$(OBJ)/.$(1)-build$(3):
$$(filter -j%,$$(MAKEFLAGS)) \ $$(filter -j%,$$(MAKEFLAGS)) \
--target "$$(CARGO_TARGET_$(3))" \ --target "$$(CARGO_TARGET_$(3))" \
--target-dir $$($(2)_OBJ$(3)) \ --target-dir $$($(2)_OBJ$(3)) \
$$(CARGO_BUILD_ARG) \ $$(CARGO_BUILD_ARGS) \
$$($(2)_CARGO_ARGS) \ $$($(2)_CARGO_ARGS) \
$$($(2)_CARGO_ARGS$(3)) $$($(2)_CARGO_ARGS$(3))
touch $$@ touch $$@