Skip to content

Instantly share code, notes, and snippets.

@nyorain
Last active August 8, 2017 16:35
Show Gist options
  • Save nyorain/608dd472a69997af65c267cf2808552d to your computer and use it in GitHub Desktop.
Save nyorain/608dd472a69997af65c267cf2808552d to your computer and use it in GitHub Desktop.
protos = [['xdg-shell', '/usr/share/wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v6.xml']]
wlscanner = find_program('wayland-scanner', required: false)
if wlscanner.found()
proto_targets = []
foreach proto : protos
code_output = proto[0] + '.c'
header_output = protoc[0] + '.h'
proto_targets += custom_target(
input: proto[1],
output: proto[0] + '_target',
capture: true,
command: [wlscanner, 'code', '@INPUT@', code_output)
proto_target += custom_target(
input: proto[1],
output: proto[0] + '_target',
capture: true,
command: [wlscanner, 'server_header', '@INPUT@', header_output)
endforeach
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment