diff options
Diffstat (limited to 'protocol/meson.build')
-rw-r--r-- | protocol/meson.build | 42 |
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, +) |