diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-05-17 21:12:09 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-05-17 21:34:13 +0100 |
commit | c1fbf654a05ac20b03906695ce340a863b05cec6 (patch) | |
tree | d5e1b0bf29756a7161664b15339dde65b1a525c3 /demos | |
parent | 1a426d6fffc39abd13e225db3ac76925df5e21b2 (diff) | |
download | gtk+-c1fbf654a05ac20b03906695ce340a863b05cec6.tar.gz |
build: Check CI envvars before rev-parse
The CI pipeline does not do a full clone, so we cannot use `git
rev-parse` to get the short SHA checksum for the current commit.
Of course, since nothing's ever easy, we cannot use vcs_tag() with a
custom command, so we need to generate our out `demo_conf.h` header
straight from a script.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/meson.build | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/demos/meson.build b/demos/meson.build index 79c530f4b7..c66d19308b 100644 --- a/demos/meson.build +++ b/demos/meson.build @@ -1,17 +1,14 @@ -demo_conf = configuration_data() -demo_conf.set_quoted('PROFILE', get_option('profile')) -demo_conf.set_quoted('VCS_TAG', '@VCS_TAG@') +gen_demo_header = find_program('../build-aux/meson/gen-demo-header.py') +demo_profile = get_option('profile') demo_conf_h = declare_dependency( - sources: vcs_tag( - command: [ 'git', 'rev-parse', '--short', 'HEAD' ], - fallback: get_option('profile') != 'default' ? 'devel' : '', - input: configure_file( - output: 'demo_conf.h.in', - configuration: demo_conf - ), - output: 'demo_conf.h' - ) + sources: custom_target('demo-header', + command: [gen_demo_header, demo_profile], + capture: true, + output: 'demo_conf.h', + build_by_default: true, + build_always_stale: true, + ) ) subdir('constraint-editor') |