From cebc95f253b292540202fa068dc607676d60180f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 Jan 2024 21:20:41 -0500 Subject: [PATCH] Automate profile setting We can derive whether we are build a developement snapshot or a stable version from the minor version number. So do that. This way, we'll get the devel profile selected in the nightly SDK, which will make the commit sha appear in the inspector, which is useful to determine what nightly users are testing. --- meson.build | 11 ++++++++++- meson_options.txt | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 357b6de9de..2192bd117a 100644 --- a/meson.build +++ b/meson.build @@ -787,9 +787,18 @@ gen_visibility_macros = find_program('build-aux/meson/gen-visibility-macros.py') gen_profile_conf = find_program('build-aux/meson/gen-profile-conf.py') +profile = get_option('profile') +if profile == 'auto' + if gtk_minor_version.is_even() + profile = 'default' + else + profile = 'devel' + endif +endif + profile_conf_h = declare_dependency( sources: custom_target('profile-conf', - command: [gen_profile_conf, meson.project_source_root(), get_option('profile')], + command: [gen_profile_conf, meson.project_source_root(), profile], capture: true, output: 'profile_conf.h', build_by_default: true, diff --git a/meson_options.txt b/meson_options.txt index db36dd5750..a96f14589c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -124,14 +124,14 @@ option('man-pages', option('demo-profile', type: 'combo', - choices: [ 'default', 'devel' ], - value: 'default', + choices: [ 'auto', 'default', 'devel' ], + value: 'auto', deprecated: 'profile') option('profile', type: 'combo', - choices: [ 'default', 'devel' ], - value: 'default', + choices: [ 'auto', 'default', 'devel' ], + value: 'auto', description : 'Profile to use for demos') option('build-demos',