summaryrefslogtreecommitdiff
path: root/protocol/meson.build
diff options
context:
space:
mode:
authorLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2020-09-24 18:01:28 +0200
committerLeon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>2020-09-24 18:01:28 +0200
commit9ff4f4959b8d78104fa4defb3c4cea9606e3c484 (patch)
treeac80aef7e1caff0d0af491ea4816ca63706a8116 /protocol/meson.build
downloadwlclock-9ff4f4959b8d78104fa4defb3c4cea9606e3c484.tar.gz
wlclock-9ff4f4959b8d78104fa4defb3c4cea9606e3c484.tar.bz2
Init
Diffstat (limited to 'protocol/meson.build')
-rw-r--r--protocol/meson.build42
1 files changed, 42 insertions, 0 deletions
diff --git a/protocol/meson.build b/protocol/meson.build
new file mode 100644
index 0000000..d5d972a
--- /dev/null
+++ b/protocol/meson.build
@@ -0,0 +1,42 @@
+wp_dir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')
+
+wayland_scanner_dep = dependency('wayland-scanner', native: true)
+wayland_scanner = find_program(
+ wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
+ native: true,
+)
+
+protocols = [
+ [ wp_dir, 'stable/xdg-shell/xdg-shell.xml' ],
+ [ wp_dir, 'unstable/xdg-output/xdg-output-unstable-v1.xml' ],
+ [ 'wlr-layer-shell-unstable-v1.xml' ],
+]
+
+wl_protocols_src = []
+wl_protocols_headers = []
+foreach p : protocols
+ xml = join_paths(p)
+ wl_protocols_src += custom_target(
+ xml.underscorify() + '_server_c',
+ input: xml,
+ output: '@BASENAME@-protocol.c',
+ command: [ wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@' ],
+ )
+ wl_protocols_headers += custom_target(
+ xml.underscorify() + '_client_h',
+ input: xml,
+ output: '@BASENAME@-protocol.h',
+ command: [ wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ],
+ )
+endforeach
+
+wl_protocols_lib = static_library(
+ 'wlclock_protocols',
+ wl_protocols_src + wl_protocols_headers,
+ dependencies: [ wayland_client ],
+)
+
+wl_protocols = declare_dependency(
+ link_with: wl_protocols_lib,
+ sources: wl_protocols_headers,
+)