Migrate embedded files to custom targets

Meson generators seem to be a dying feature, evidenced by the fact that they have been in a state of isolation from the rest of the language for several years at this point:

 - very few things accept generator outputs as inputs, not even generators themselves do
 - unlike configured files, their outputs aren't guaranteed to be always synthesized, and yet they can't be passed as dependencies to other targets
 - they accept strictly one input and can't depend on other files

This makes them really hard to work with in a context that would require either a project resource or a target. Custom targets don't have any of these shortcomings, so this commit migrates embedded files over to those. A real shame, considering that generators can be used anywhere and are generally less messy than custom targets.
This commit is contained in:
Tamás Bálint Misius
2024-12-17 14:46:46 +01:00
parent c62f105c85
commit 1ef78c019a
11 changed files with 45 additions and 31 deletions

View File

@@ -99,14 +99,16 @@ elif host_platform == 'darwin'
configuration: conf_data,
)
elif host_platform == 'linux'
data_files += to_array.process(rendered_icons['icon_exe'], extra_args: 'icon_exe_png')
data_files += to_array.process(rendered_icons['icon_cps'], extra_args: 'icon_cps_png')
data_files += to_array.process('save.xml', extra_args: 'save_xml')
data_files += to_array.process(configure_file(
input: 'powder.template.desktop',
output: 'powder.desktop',
configuration: conf_data,
), extra_args: 'powder_desktop')
embedded_files += [
[ 'icon_exe_png', rendered_icons['icon_exe'] ],
[ 'icon_cps_png', rendered_icons['icon_cps'] ],
[ 'save_xml', files('save.xml') ],
[ 'powder_desktop', configure_file(
input: 'powder.template.desktop',
output: 'powder.desktop',
configuration: conf_data,
) ],
]
configure_file(
input: 'appdata.template.xml',
@@ -115,7 +117,9 @@ elif host_platform == 'linux'
)
endif
data_files += to_array.process('save_local.png', extra_args: 'save_local_png')
data_files += to_array.process('save_online.png', extra_args: 'save_online_png')
data_files += to_array.process('font.bz2', extra_args: 'compressed_font_data')
data_files += to_array.process('credits.json', extra_args: 'credits_json')
embedded_files += [
[ 'save_local_png', files('save_local.png') ],
[ 'save_online_png', files('save_online.png') ],
[ 'font_bz2', files('font.bz2') ],
[ 'credits_json', files('credits.json') ],
]