build: replace assembly embedding with Python script

This allows Meson to properly track dependencies and re-build the scanner when
editing the dtd. We also stop depending on GNU as' .incbin and make the
embedding less obscure.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2020-12-15 20:35:25 +01:00
parent e475decf1d
commit f452e41264
4 changed files with 58 additions and 59 deletions

View file

@ -34,13 +34,17 @@ if get_option('scanner')
scanner_args += '-DHAVE_LIBXML=1'
endif
configure_file(
prog_embed = find_program('embed.py', native: true)
embed_dtd = custom_target(
'wayland.dtd.h',
input: '../protocol/wayland.dtd',
output: 'wayland.dtd.embed',
copy: true
output: 'wayland.dtd.h',
command: [ prog_embed, '@INPUT@', 'wayland_dtd' ],
capture: true
)
wayland_scanner_sources = [ 'scanner.c', 'dtddata.S' ]
wayland_scanner_sources = [ 'scanner.c', embed_dtd ]
wayland_scanner_includes = [ root_inc, protocol_inc ]
wayland_scanner = executable(