2017-03-12 16:54:44 +00:00
|
|
|
# demos/widget-factory
|
2016-08-21 14:00:37 +00:00
|
|
|
|
2021-10-01 02:41:36 +00:00
|
|
|
objcopy_supports_add_symbol = false
|
|
|
|
objcopy = find_program('objcopy', required : false)
|
|
|
|
if objcopy.found()
|
|
|
|
objcopy_supports_add_symbol = run_command(objcopy, '--help').stdout().contains('--add-symbol')
|
|
|
|
endif
|
|
|
|
|
|
|
|
ld = find_program('ld', required : false)
|
|
|
|
|
|
|
|
if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
|
|
|
glib_compile_resources = find_program('glib-compile-resources')
|
|
|
|
|
|
|
|
# Create the resource blob
|
|
|
|
widgetfactory_gresource = custom_target('widgetfactory.gresource',
|
|
|
|
input : 'widget-factory.gresource.xml',
|
|
|
|
output : 'widgetfactory.gresource',
|
2021-10-04 01:01:04 +00:00
|
|
|
depfile: 'widgetfactory.gresource.d',
|
2021-10-01 02:41:36 +00:00
|
|
|
command : [glib_compile_resources,
|
2021-10-04 01:01:04 +00:00
|
|
|
'--generate',
|
2021-10-01 02:41:36 +00:00
|
|
|
'--target=@OUTPUT@',
|
2021-10-04 01:01:04 +00:00
|
|
|
'--dependency-file=@DEPFILE@',
|
2021-10-01 02:41:36 +00:00
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
# Create resource data file
|
|
|
|
widgetfactory_resources_c = custom_target('widgetfactory_resources.c',
|
|
|
|
input : 'widget-factory.gresource.xml',
|
|
|
|
output : 'widgetfactory_resources.c',
|
2021-10-04 01:01:04 +00:00
|
|
|
depfile: 'widgetfactory_resources.c.d',
|
2021-10-01 02:41:36 +00:00
|
|
|
command : [glib_compile_resources,
|
2021-10-04 01:01:04 +00:00
|
|
|
'--generate-source',
|
2021-10-01 02:41:36 +00:00
|
|
|
'--target=@OUTPUT@',
|
2021-10-04 01:01:04 +00:00
|
|
|
'--dependency-file=@DEPFILE@',
|
2021-10-01 02:41:36 +00:00
|
|
|
'--sourcedir=' + meson.current_source_dir(),
|
|
|
|
'--sourcedir=' + meson.current_build_dir(),
|
|
|
|
'--external-data',
|
|
|
|
'--c-name', '_g_binary_widgetfactory',
|
|
|
|
'@INPUT@'])
|
|
|
|
|
|
|
|
# Create object file containing resource data
|
|
|
|
widgetfactory_resources_binary = custom_target('widgetfactory_resources.o',
|
|
|
|
input : widgetfactory_gresource,
|
|
|
|
output : 'widgetfactory_resources.o',
|
|
|
|
command : [ld,
|
|
|
|
'-r',
|
|
|
|
'-b','binary',
|
|
|
|
'@INPUT@',
|
|
|
|
'-o','@OUTPUT@'])
|
|
|
|
|
|
|
|
# Rename symbol to match the one in the C file
|
|
|
|
widgetfactory_resources_o = custom_target('widgetfactory_resources2.o',
|
|
|
|
input : widgetfactory_resources_binary,
|
|
|
|
output : 'widgetfactory_resources2.o',
|
|
|
|
command : [objcopy,
|
|
|
|
'--add-symbol','_g_binary_widgetfactory_resource_data=.data:0',
|
|
|
|
'@INPUT@',
|
|
|
|
'@OUTPUT@'])
|
|
|
|
|
|
|
|
widgetfactory_resources = [
|
|
|
|
widgetfactory_resources_c,
|
|
|
|
widgetfactory_resources_o,
|
|
|
|
]
|
|
|
|
else
|
|
|
|
widgetfactory_resources = gnome.compile_resources('widgetfactory_resources',
|
|
|
|
'widget-factory.gresource.xml',
|
|
|
|
source_dir: '.',
|
|
|
|
)
|
|
|
|
endif
|
2016-08-21 14:00:37 +00:00
|
|
|
|
2017-03-12 16:54:44 +00:00
|
|
|
executable('gtk4-widget-factory',
|
2021-10-03 03:54:06 +00:00
|
|
|
sources: ['widget-factory.c', widgetfactory_resources],
|
2020-12-15 12:31:38 +00:00
|
|
|
c_args: common_cflags,
|
2021-02-12 04:35:26 +00:00
|
|
|
dependencies: [ libgtk_dep, demo_conf_h ],
|
2020-12-15 12:31:38 +00:00
|
|
|
include_directories: confinc,
|
2021-12-24 15:51:11 +00:00
|
|
|
win_subsystem: 'windows',
|
2020-12-15 12:31:38 +00:00
|
|
|
link_args: extra_demo_ldflags,
|
|
|
|
install: true,
|
|
|
|
)
|
2017-03-12 16:54:44 +00:00
|
|
|
|
|
|
|
# desktop file
|
2019-04-01 23:58:30 +00:00
|
|
|
install_data('org.gtk.WidgetFactory4.desktop', install_dir: gtk_applicationsdir)
|
2017-03-12 16:54:44 +00:00
|
|
|
|
|
|
|
# icons
|
2017-04-26 16:04:20 +00:00
|
|
|
icontheme_dir = join_paths(gtk_datadir, 'icons/hicolor')
|
2017-03-12 16:54:44 +00:00
|
|
|
|
2019-02-06 14:37:25 +00:00
|
|
|
foreach size: ['scalable', 'symbolic']
|
2020-12-15 12:31:38 +00:00
|
|
|
install_subdir('data/' + size, install_dir: icontheme_dir)
|
2017-03-12 16:54:44 +00:00
|
|
|
endforeach
|
2018-03-21 00:04:20 +00:00
|
|
|
|
|
|
|
# appdata
|
2021-06-01 12:16:27 +00:00
|
|
|
configure_file(
|
|
|
|
input: 'org.gtk.WidgetFactory4.appdata.xml.in',
|
|
|
|
output: 'org.gtk.WidgetFactory4.appdata.xml',
|
|
|
|
configuration: appdata_config,
|
|
|
|
install_dir: gtk_appdatadir
|
|
|
|
)
|