Skip to content

Commit

Permalink
sdl: move version logic from source code to makefile
Browse files Browse the repository at this point in the history
Compile sdl.c / sdl2.c depending on CONFIG_SDLABI instead of
compiling both and have version #ifdefs in the source code.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
  • Loading branch information
kraxel committed Dec 16, 2014
1 parent dfa9c2a commit d29c431
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 6 additions & 1 deletion ui/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ common-obj-$(CONFIG_CURSES) += curses.o
common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o

sdl.mo-objs := sdl.o sdl_zoom.o sdl2.o
ifeq ($(CONFIG_SDLABI),1.2)
sdl.mo-objs := sdl.o sdl_zoom.o
endif
ifeq ($(CONFIG_SDLABI),2.0)
sdl.mo-objs := sdl2.o
endif
sdl.mo-cflags := $(SDL_CFLAGS)

gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
3 changes: 0 additions & 3 deletions ui/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#undef WIN32_LEAN_AND_MEAN

#include <SDL.h>

#if SDL_MAJOR_VERSION == 1
#include <SDL_syswm.h>

#include "qemu-common.h"
Expand Down Expand Up @@ -958,4 +956,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)

atexit(sdl_cleanup);
}
#endif
3 changes: 0 additions & 3 deletions ui/sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#undef WIN32_LEAN_AND_MEAN

#include <SDL.h>

#if SDL_MAJOR_VERSION == 2
#include <SDL_syswm.h>

#include "qemu-common.h"
Expand Down Expand Up @@ -912,4 +910,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)

atexit(sdl_cleanup);
}
#endif

0 comments on commit d29c431

Please sign in to comment.