Use pkg-config to configure SDL

Define MICROPY_SDL if sdl2 is installed.
Remove internal SDL driver, use LVGL SDL driver instead.
This commit is contained in:
Amir Gonnen 2023-01-19 23:39:15 +02:00
parent db979250af
commit 5e65bc2e03
2 changed files with 9 additions and 5 deletions

@ -1 +1 @@
Subproject commit 6e437878fbfebfd15406a8cf8b5a8967af0833cd
Subproject commit 60b51a8ebaf4b89321041aebdd9434567b404758

View File

@ -99,7 +99,7 @@ else
# Use gcc syntax for map file
LDFLAGS_ARCH = -Wl,-Map=$@.map,--cref -Wl,--gc-sections
endif
LDFLAGS += $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA) -lSDL2
LDFLAGS += $(LDFLAGS_MOD) $(LDFLAGS_ARCH) -lm $(LDFLAGS_EXTRA)
# Flags to link with pthread library
LIBPTHREAD = -lpthread
@ -219,6 +219,13 @@ endif
# Additional optional libraries
SDL_CFLAGS_MOD := $(shell pkg-config --silence-errors --cflags sdl2)
SDL_LDFLAGS_MOD := $(shell pkg-config --silence-errors --libs sdl2)
ifneq ($(SDL_LDFLAGS_MOD),)
CFLAGS_MOD += $(SDL_CFLAGS_MOD) -DMICROPY_SDL=1
LDFLAGS_MOD += $(SDL_LDFLAGS_MOD)
endif
RLOTTIE_CFLAGS_MOD := $(shell pkg-config --silence-errors --cflags rlottie)
RLOTTIE_LDFLAGS_MOD := $(shell pkg-config --silence-errors --libs rlottie)
ifneq ($(RLOTTIE_LDFLAGS_MOD),)
@ -262,9 +269,6 @@ SRC_C += \
$(wildcard $(VARIANT_DIR)/*.c)
LIB_SRC_C += $(addprefix lib/,\
lv_bindings/driver/SDL/sdl_common.c \
lv_bindings/driver/SDL/sdl.c \
lv_bindings/driver/SDL/modSDL.c \
$(LIB_SRC_C_EXTRA) \
)