From 69077169545427acb2e8a3f1a487e6c144ed6f20 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 29 Mar 2022 01:52:01 -0700 Subject: build: make sdl2 and rototiller bin optional Now that there's a decoupled libtil usable by alternative frontends by vendoring rototiller, the build should support fb-less rototiller-less configurations. In lieu of this change glimmer's build requires sdl2 despite not actually utilizing sdl_fb. Now that shouldn't be necessary, should there be neither libdrm or sdl2 present we'll only produce libtil and no rototiller binary at all. --- src/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c6b0362..c19b6b5 100644 --- a/src/main.c +++ b/src/main.c @@ -27,7 +27,11 @@ * another page so we can begin rendering another frame before vsync. With * just two pages we end up twiddling thumbs until the vsync arrives. */ +#ifdef HAVE_SDL #define DEFAULT_VIDEO "sdl" +#else +#define DEFAULT_VIDEO "drm" +#endif extern til_fb_ops_t drm_fb_ops; extern til_fb_ops_t sdl_fb_ops; @@ -68,7 +72,9 @@ static int setup_video(til_settings_t *settings, til_setting_t **res_setting, co #ifdef HAVE_DRM "drm", #endif +#ifdef HAVE_SDL "sdl", +#endif NULL, }; int r; @@ -96,13 +102,15 @@ static int setup_video(til_settings_t *settings, til_setting_t **res_setting, co fb_ops = &drm_fb_ops; return drm_fb_ops.setup(settings, res_setting, res_desc); - } else + } #endif +#ifdef HAVE_SDL if (!strcmp(video, "sdl")) { fb_ops = &sdl_fb_ops; return sdl_fb_ops.setup(settings, res_setting, res_desc); } +#endif return -EINVAL; } -- cgit v1.2.1