diff options
-rw-r--r-- | common.h | 11 | ||||
-rw-r--r-- | meson.build | 29 |
2 files changed, 30 insertions, 10 deletions
@@ -175,7 +175,18 @@ enum mode { const struct egl * init_cube_smooth(const struct gbm *gbm, int samples); const struct egl * init_cube_tex(const struct gbm *gbm, enum mode mode, int samples); + +#ifdef HAVE_GLES3 const struct egl * init_cube_shadertoy(const struct gbm *gbm, const char *shadertoy, int samples); +#else +static inline const struct egl * +init_cube_shadertoy(const struct gbm *gbm, const char *shadertoy, int samples) +{ + (void)gbm; (void)shadertoy; (void)samples; + printf("no GLES3 support!\n"); + return NULL; +} +#endif #ifdef HAVE_GST diff --git a/meson.build b/meson.build index 4fca2f2..518006f 100644 --- a/meson.build +++ b/meson.build @@ -35,7 +35,6 @@ endif sources = files( 'common.c', - 'cube-shadertoy.c', 'cube-smooth.c', 'cube-tex.c', 'drm-atomic.c', @@ -55,13 +54,22 @@ dep_libdrm = dependency('libdrm', version : '>=2.4.71') dep_gbm = dependency('gbm', version : '>=13.0') dep_egl = dependency('egl') dep_gles2 = dependency('glesv2') +dep_gles3 = dependency('glesv2', version : '>= 3', required : false) + +if dep_gles3.found() + sources += files('cube-shadertoy.c') + add_project_arguments('-DHAVE_GLES3', language : 'c') + message('GLES3 supported; shadertoy & texturator are included in this build') +else + message('GLES3 not supported; shadertoy & texturator are NOT included in this build') +endif + dep_libpng = dependency('libpng', required : false) if dep_libpng.found() add_project_arguments('-DHAVE_LIBPNG', language : 'c') endif - dep_common = [dep_m, dep_threads, dep_libdrm, dep_gbm, dep_egl, dep_gles2, dep_libpng] dep_gst = [] @@ -95,11 +103,12 @@ endif executable('kmscube', sources, dependencies : dep_common, install : true) - -executable('texturator', files( - 'common.c', - 'drm-legacy.c', - 'drm-common.c', - 'perfcntrs.c', # not used, but required to link - 'texturator.c', -), dependencies : dep_common, install : true) +if dep_gles3.found() + executable('texturator', files( + 'common.c', + 'drm-legacy.c', + 'drm-common.c', + 'perfcntrs.c', # not used, but required to link + 'texturator.c', + ), dependencies : dep_common, install : true) +endif |