makefile: simplify building Video support by leveraging sdl-config and sdl2-config
This commit is contained in:
parent
2b155ba29d
commit
fb36c22058
1 changed files with 6 additions and 12 deletions
18
makefile
18
makefile
|
@ -424,30 +424,24 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
|||
endif
|
||||
ifneq (,$(call find_include,SDL2/SDL))
|
||||
ifneq (,$(call find_lib,SDL2))
|
||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO -I$(dir $(call find_include,SDL2/SDL))
|
||||
VIDEO_LDFLAGS += -lSDL2
|
||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config) --cflags`
|
||||
VIDEO_LDFLAGS += `$(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config) --static-libs`
|
||||
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
|
||||
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
||||
DISPLAYVT = ${DISPLAYD}/vt11.c
|
||||
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS)
|
||||
$(info using libSDL2: $(call find_lib,SDL2) $(call find_include,SDL2/SDL))
|
||||
ifeq (Darwin,$(OSTYPE))
|
||||
VIDEO_LDFLAGS += -lobjc -framework cocoa -DSDL_MAIN_AVAILABLE
|
||||
endif
|
||||
$(info using libSDL2: $(call find_include,SDL2/SDL))
|
||||
endif
|
||||
else
|
||||
ifneq (,$(call find_include,SDL/SDL))
|
||||
ifneq (,$(call find_lib,SDL))
|
||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO -I$(dir $(call find_include,SDL/SDL))
|
||||
VIDEO_LDFLAGS += -lSDL
|
||||
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config) --cflags`
|
||||
VIDEO_LDFLAGS += `$(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config) --static-libs`
|
||||
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer)
|
||||
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
|
||||
DISPLAYVT = ${DISPLAYD}/vt11.c
|
||||
DISPLAY_OPT += -DUSE_DISPLAY $(VIDEO_CCDEFS) $(VIDEO_LDFLAGS)
|
||||
$(info using libSDL: $(call find_lib,SDL) $(call find_include,SDL/SDL))
|
||||
ifeq (Darwin,$(OSTYPE))
|
||||
VIDEO_LDFLAGS += -lobjc -framework cocoa -DSDL_MAIN_AVAILABLE
|
||||
endif
|
||||
$(info using libSDL: $(call find_include,SDL/SDL))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Add table
Reference in a new issue