mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
qb: Improve the gnu99 compiler check.
This commit is contained in:
parent
de052537ec
commit
4171c93bff
24
Makefile
24
Makefile
@ -106,6 +106,16 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
LDFLAGS += -mwindows
|
||||
endif
|
||||
|
||||
ifneq ($(CXX_BUILD), 1)
|
||||
ifneq ($(C89_BUILD),)
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long
|
||||
else ifeq ($(HAVE_C99), 1)
|
||||
CFLAGS += $(C99_CFLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
DEF_FLAGS += -Wall $(INCLUDE_DIRS) -I. -Ideps -Ideps/stb
|
||||
|
||||
CFLAGS += $(DEF_FLAGS)
|
||||
@ -127,20 +137,6 @@ else
|
||||
LINK = $(CC)
|
||||
endif
|
||||
|
||||
ifneq ($(CXX_BUILD), 1)
|
||||
ifneq ($(GNU90_BUILD), 1)
|
||||
ifneq ($(findstring icc,$(CC)),)
|
||||
CFLAGS += -std=c99 -D_GNU_SOURCE
|
||||
else
|
||||
CFLAGS += -std=gnu99 -D_GNU_SOURCE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(C89_BUILD),)
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(NOUNUSED), yes)
|
||||
CFLAGS += -Wno-unused-result
|
||||
CXXFLAGS += -Wno-unused-result
|
||||
|
@ -4,7 +4,13 @@
|
||||
# Only needed when check_enabled ($2), check_platform, check_lib, check_pkgconf,
|
||||
# check_header, check_macro and check_switch are not used.
|
||||
|
||||
check_switch '' C99 -std=gnu99 "Cannot find C99 compatible compiler."
|
||||
check_switch '' C99 -std=gnu99 ''
|
||||
|
||||
if [ "$HAVE_C99" = 'no' ]; then
|
||||
HAVE_C99='auto'
|
||||
check_switch '' C99 -std=c99 'Cannot find a C99 compatible compiler.'
|
||||
fi
|
||||
|
||||
check_switch cxx CXX11 -std=c++11 ''
|
||||
check_switch '' NOUNUSED -Wno-unused-result ''
|
||||
add_define MAKEFILE NOUNUSED "$HAVE_NOUNUSED"
|
||||
|
Loading…
x
Reference in New Issue
Block a user