Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
SDL debug tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Dec 11, 2017
1 parent 9819e1c commit 258cfa7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
44 changes: 42 additions & 2 deletions BUILD.SDL2
@@ -1,15 +1,18 @@
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)

config_setting(
name = "darwin_x86_64",
values = {"cpu": "darwin_x86_64"},
visibility = ["//visibility:public"],
)

config_setting(
name = "linux_x86_64",
values = {"cpu": "k8"},
)

cc_library(
name = 'includarama',
textual_hdrs = glob(['src/**']),
Expand All @@ -32,6 +35,36 @@ objc_library(
copts = ['-fno-objc-arc'],
)

DEFS_LINUX = [
'SDL_config_h_',
'HAVE_STDARG_H=1',
'HAVE_STDDEF_H=1',
'HAVE_STDINT_H=1',
'HAVE_ALLOCA_H=1',
'HAVE_GCC_SYNC_LOCK_TEST_AND_SET=1',
'SDL_AUDIO_DRIVER_DUMMY=1',
'SDL_JOYSTICK_DISABLED=1',
'SDL_HAPTIC_DISABLED=1',
'SDL_LOADSO_DLOPEN=1',
'SDL_THREAD_PTHREAD=1',
'SDL_THREAD_PTHREAD_RECURSIVE_MUTEX=1',
'SDL_TIMERS_DISABLED=1',
'SDL_FILESYSTEM_DUMMY=1',
'SDL_VIDEO_DRIVER_DUMMY=1',
'SDL_VIDEO_DRIVER_X11=1',
'SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS=1',
'SDL_VIDEO_DRIVER_X11_DYNAMIC=\\"/usr/lib/x86_64-linux-gnu/libX11.so.6\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT=\\"/usr/lib/x86_64-linux-gnu/libXext.so.6\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA=\\"/usr/lib/x86_64-linux-gnu/libXinerama.so.1\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2=\\"/usr/lib/x86_64-linux-gnu/libXi.so.6\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR=\\"/usr/lib/x86_64-linux-gnu/libXrandr.so.2\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS=\\"/usr/lib/x86_64-linux-gnu/libXss.so.1\\"',
'SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE=\\"/usr/lib/x86_64-linux-gnu/libXxf86vm.so.1\\"',
'SDL_VIDEO_DRIVER_X11_XDBE=1',
'SDL_VIDEO_OPENGL_GLX=1',
'__LINUX__',
]

cc_library(
name = 'sdl2',
hdrs = glob(['include/*.h']),
Expand All @@ -53,5 +86,12 @@ cc_library(
':darwin_x86_64': [':cocomo'],
'//conditions:default': [],
}),
copts = select({
'//conditions:default': [],
':linux_x86_64': [
'-D%s' % d
for d in DEFS_LINUX
]
}),
visibility = ['//visibility:public'],
)
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -38,3 +38,6 @@ BUILD REQUIREMENTS
- pip install lxml
- gperf

Linux only:
- opengl headers

2 changes: 1 addition & 1 deletion sdl_info.cc
Expand Up @@ -20,7 +20,7 @@ class SDLInfo final : public Application {
public:
SDLInfo(int argc, char** argv) {}
int Run() {
if (SDL_GetNumVideoDrivers()) {
if (SDL_GetNumVideoDrivers() == 0) {
printf("NO VIDEO DRIVERS\n");
} else {
printf("VIDEO DRIVERS:\n");
Expand Down

0 comments on commit 258cfa7

Please sign in to comment.