From 3ecede86c3a35c88f17051fb1145c8506218ada4 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 9 Feb 2020 11:41:43 +0000 Subject: [PATCH] Build examples using meson --- examples/meson.build | 29 +++++++++++++++++++++++++++++ meson.build | 4 ++++ meson_options.txt | 1 + 3 files changed, 34 insertions(+) create mode 100644 examples/meson.build diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000..7e8980c --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,29 @@ +libpng = dependency('libpng', required: false) + +executable( + 'draw', + [ + 'draw.c', + ], + dependencies: [ + neatvnc_dep, + pixman, + libuv, + ] +) + +if libpng.found() + executable( + 'png-server', + [ + 'png-server.c', + '../src/pngfb.c', + ], + dependencies: [ + neatvnc_dep, + pixman, + libuv, + libpng, + ] + ) +endif diff --git a/meson.build b/meson.build index acd374f..1c2f7da 100644 --- a/meson.build +++ b/meson.build @@ -91,6 +91,10 @@ neatvnc_dep = declare_dependency( link_with: neatvnc, ) +if get_option('examples') + subdir('examples') +endif + install_headers('include/neatvnc.h') pkgconfig = import('pkgconfig') diff --git a/meson_options.txt b/meson_options.txt index f161b12..22bc33a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('tight-encoding', type: 'feature', value: 'disabled', description: 'Enable Tight encoding (experimental)') option('tls', type: 'feature', value: 'auto', description: 'Enable encryption & authentication') +option('examples', type: 'boolean', value: false, description: 'Build examples')