Making libretro compile without warnings with GCC

This commit is contained in:
Lior Halphon 2020-04-28 21:44:29 +03:00
parent c64d5b58b6
commit 1e54c55c11

View File

@ -89,14 +89,16 @@ OPEN_DIALOG = OpenDialog/cocoa.m
endif endif
# These must come before the -Wno- flags # These must come before the -Wno- flags
CFLAGS += -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option WARNINGS += -Werror -Wall -Wno-unknown-warning -Wno-unknown-warning-option
CFLAGS += -Wno-nonnull -Wno-unused-result -Wno-strict-aliasing -Wno-multichar -Wno-int-in-bool-context WARNINGS += -Wno-nonnull -Wno-unused-result -Wno-strict-aliasing -Wno-multichar -Wno-int-in-bool-context
# Only add this flag if the compiler supports it # Only add this flag if the compiler supports it
ifeq ($(shell $(CC) -x c -c $(NULL) -o $(NULL) -Werror -Wpartial-availability 2> $(NULL); echo $$?),0) ifeq ($(shell $(CC) -x c -c $(NULL) -o $(NULL) -Werror -Wpartial-availability 2> $(NULL); echo $$?),0)
CFLAGS += -Wpartial-availability WARNINGS += -Wpartial-availability
endif endif
CFLAGS += $(WARNINGS)
CFLAGS += -std=gnu11 -D_GNU_SOURCE -DVERSION="$(VERSION)" -I. -D_USE_MATH_DEFINES CFLAGS += -std=gnu11 -D_GNU_SOURCE -DVERSION="$(VERSION)" -I. -D_USE_MATH_DEFINES
ifeq (,$(PKG_CONFIG)) ifeq (,$(PKG_CONFIG))
@ -396,7 +398,7 @@ $(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb8
# Libretro Core (uses its own build system) # Libretro Core (uses its own build system)
libretro: libretro:
$(MAKE) -C libretro CFLAGS="$(WARNINGS)" $(MAKE) -C libretro
# Clean # Clean
clean: clean: