aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-20 13:58:08 -0400
committerDavid Robillard <d@drobilla.net>2022-05-21 15:33:21 -0400
commitfd446ed67d9b697a150a59fa6746555af283127d (patch)
tree16bc9f51d422a785044a7f3a6a53fa18c23e9b4c
parenta8a0fed38c2b5a6fc479c26dbd9fba7b23879c9e (diff)
downloadpugl-fd446ed67d9b697a150a59fa6746555af283127d.tar.gz
pugl-fd446ed67d9b697a150a59fa6746555af283127d.tar.bz2
pugl-fd446ed67d9b697a150a59fa6746555af283127d.zip
Fix build of examples that use a stub backend
-rw-r--r--examples/meson.build24
1 files changed, 21 insertions, 3 deletions
diff --git a/examples/meson.build b/examples/meson.build
index a4bf84c..0308d2c 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -4,10 +4,14 @@
data_dir = get_option('prefix') / get_option('datadir') / 'pugl-0'
example_defines = ['-DPUGL_DATA_DIR="@0@"'.format(data_dir)]
+stub_examples = [
+ 'pugl_print_events.c',
+]
+
gl_examples = [
'pugl_cpp_demo.cpp',
+ 'pugl_cursor_demo.c',
'pugl_embed_demo.c',
- 'pugl_print_events.c',
'pugl_shader_demo.c',
'pugl_window_demo.c',
]
@@ -77,7 +81,6 @@ subdir('shaders')
if host_machine.system() == 'darwin'
# On Darwin, build examples as application bundles (required to work properly)
- subdir('pugl_cursor_demo.app')
if cairo_dep.found()
subdir('pugl_cairo_demo.app')
@@ -85,6 +88,7 @@ if host_machine.system() == 'darwin'
if opengl_dep.found()
subdir('pugl_cpp_demo.app')
+ subdir('pugl_cursor_demo.app')
subdir('pugl_embed_demo.app')
subdir('pugl_shader_demo.app')
subdir('pugl_window_demo.app')
@@ -98,12 +102,26 @@ if host_machine.system() == 'darwin'
else
# On all other platforms, build examples as simple programs
+ # Build stub examples
+ foreach example : stub_examples
+ source = [example]
+ target = example.split('.')[0]
+ dependencies = [pugl_dep, stub_backend_dep]
+ defines = []
+
+ executable(target, source,
+ include_directories: includes,
+ c_args: example_defines + example_c_args + defines,
+ cpp_args: example_defines + example_cpp_args + defines,
+ dependencies: dependencies)
+ endforeach
+
# Build GL examples
if opengl_dep.found()
foreach example : gl_examples
source = [example]
target = example.split('.')[0]
- dependencies = [gl_backend_dep]
+ dependencies = [pugl_dep, gl_backend_dep]
defines = []
if target == 'pugl_shader_demo'