Hi
I have a problem with blueprint setup for vala.
More specifically when I try to use .ui file with Gtk.Builder
after compilation everything works fine, but when I use it using [GtkTemplate (ui = "...")]
it won’t even compile.
Layout
res/
ui/
*.blp
*.gresource.xml
meson.build
src/
*.vala
meson.build
meson.build
project(...)
subdir('res')
dependencies = [
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('libadwaita-1'),
]
sources = import( 'gnome' ).compile_resources(
meson.project_name() + '.resources',
join_paths('res', meson.project_name() + '.gresource.xml'),
source_dir: ['res'],
dependencies: blueprints,
)
sources += files(
run_command('find', '.', '-name', '*.vala').stdout().strip().split('\n')
)
executable('...', sources, dependencies: dependencies)
res/meson.build
blueprints = custom_target('blueprints',
input: run_command('find', '.', '-name', '*.blp').stdout().strip().split('\n'),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)