From f0bca570b2c6f24bd49f283c2365c90e7b130cd5 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 12 Oct 2019 15:24:57 +0000 Subject: [PATCH] Add meson.build --- meson.build | 67 +++++++++++++++++++++++++++++++++++++++++++ protocols/meson.build | 40 ++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 meson.build create mode 100644 protocols/meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..02de0a2 --- /dev/null +++ b/meson.build @@ -0,0 +1,67 @@ +project( + 'wayvnc', + 'c', + version: '0.0.0', + license: 'ISC', + default_options: [ + 'c_std=gnu11', + ], +) + +add_project_arguments([ + '-D_GNU_SOURCE', + '-fvisibility=hidden', +], language: 'c') + +cc = meson.get_compiler('c') + +libm = cc.find_library('m', required: false) + +pixman = dependency('pixman-1') +libuv = dependency('libuv') +egl = dependency('egl') +glesv2 = dependency('glesv2') +wayland_client = dependency('wayland-client') + +neatvnc_project = subproject( + 'neatvnc', + required: false, +) + +if neatvnc_project.found() + neatvnc = neatvnc_project.get_variable('neatvnc_dep') +else + neatvnc = dependency('neatvnc') +endif + +inc = include_directories('include') + +subdir('protocols') + +sources = [ + 'src/main.c', + 'src/render.c', + 'src/dmabuf.c', + 'src/strlcpy.c', + 'src/shm.c', + 'src/screencopy.c', +] + +dependencies = [ + libm, + pixman, + libuv, + egl, + glesv2, + wayland_client, + neatvnc, + client_protos, +] + +executable( + 'wayvnc', + sources, + dependencies: dependencies, + include_directories: inc, + install: true, +) diff --git a/protocols/meson.build b/protocols/meson.build new file mode 100644 index 0000000..e139ad1 --- /dev/null +++ b/protocols/meson.build @@ -0,0 +1,40 @@ +wayland_scanner = find_program('wayland-scanner') +wayland_client = dependency('wayland-client') + +wayland_scanner_code = generator( + wayland_scanner, + output: '@BASENAME@.c', + arguments: ['private-code', '@INPUT@', '@OUTPUT@'], +) + +wayland_scanner_client = generator( + wayland_scanner, + output: '@BASENAME@.h', + arguments: ['client-header', '@INPUT@', '@OUTPUT@'], +) + +client_protocols = [ + 'wlr-export-dmabuf-unstable-v1.xml', + 'wlr-screencopy-unstable-v1.xml', +] + +client_protos_src = [] +client_protos_headers = [] + +foreach xml: client_protocols + client_protos_src += wayland_scanner_code.process(xml) + client_protos_headers += wayland_scanner_client.process(xml) +endforeach + +lib_client_protos = static_library( + 'client_protos', + client_protos_src + client_protos_headers, + dependencies: [ + wayland_client + ] +) + +client_protos = declare_dependency( + link_with: lib_client_protos, + sources: client_protos_headers, +)