diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-09-18 23:16:41 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-09-18 23:18:31 -0400 |
commit | 226e6f64b5325dd00bd468d7485519bd3204761f (patch) | |
tree | 8f3bd9f41dbc5a910f356263185fba1863ce468b | |
parent | 1fae91d12350a71d550c65e23be5eec5a5a00253 (diff) | |
download | gtk+-faster-resources.tar.gz |
widget-factory: Generate resources directlyfaster-resources
Use a small assembler file to include the resource
bundle into the binary. This avoids going through
cpp and gcc with a huge input file.
-rw-r--r-- | demos/widget-factory/meson.build | 19 | ||||
-rw-r--r-- | demos/widget-factory/widget-factory-resources.s | 6 |
2 files changed, 22 insertions, 3 deletions
diff --git a/demos/widget-factory/meson.build b/demos/widget-factory/meson.build index 1cebd4adc5..9e807848ad 100644 --- a/demos/widget-factory/meson.build +++ b/demos/widget-factory/meson.build @@ -3,16 +3,29 @@ widgetfactory_resources = gnome.compile_resources('widgetfactory_resources', 'widget-factory.gresource.xml', source_dir: '.', + extra_args: ['--external-data'], +) + +custom_target('widget_factory.gresource', + build_by_default: true, + output: 'widget_factory.gresource', + input: ['widget-factory.gresource.xml'], + command: [ + find_program('glib-compile-resources'), + '--generate', + '--target=@OUTPUT@', + '--sourcedir=@CURRENT_SOURCE_DIR@', + '@INPUT@'] ) executable('gtk4-widget-factory', - sources: ['widget-factory.c', widgetfactory_resources], + sources: ['widget-factory.c', widgetfactory_resources, 'widget-factory-resources.s'], c_args: common_cflags, - dependencies: [ libgtk_dep, demo_conf_h ], + dependencies: [ libgtk_dep, demo_conf_h], include_directories: confinc, gui_app: true, link_args: extra_demo_ldflags, - install: true, + install: true ) # desktop file diff --git a/demos/widget-factory/widget-factory-resources.s b/demos/widget-factory/widget-factory-resources.s new file mode 100644 index 0000000000..31e4345af1 --- /dev/null +++ b/demos/widget-factory/widget-factory-resources.s @@ -0,0 +1,6 @@ + .global widget_factory_resource_data +widget_factory_resource_data: + .incbin "widget_factory.gresource" + .global widget_factory_resource_data_end +widget_factory_resource_data_end: + .byte 0 |