build: replace 'profile' option with 'is_devel' flag

This commit is contained in:
Vladimir Vaskov 2024-07-28 17:43:16 +03:00
parent 5c21a4caf7
commit da69278875
No known key found for this signature in database
GPG key ID: CECAF75A5D478132
5 changed files with 8 additions and 15 deletions

View file

@ -49,7 +49,7 @@
"name" : "cassette",
"builddir" : true,
"buildsystem" : "meson",
"config-opts": [ "-Dprofile=development" ],
"config-opts": [ "-Dis_devel=true" ],
"sources" : [
{
"type" : "dir",

View file

@ -24,19 +24,17 @@ gio = dependency('gio-2.0', version: '>= 2.72')
app_id = 'io.github.Rirusha.Cassette'
if get_option('profile') == 'development'
if get_option('is_devel')
find_program('git', required: true)
name_postfix = ' (Devel)'
app_id_dyn = '@0@-Devel'.format(app_id)
app_identity_dyn = 'Cassette (Devel)'
profile = 'Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
version_suffix = '-dev.@0@'.format (vcs_tag)
else
name_postfix = ''
app_id_dyn = app_id
app_identity_dyn = 'Cassette'
profile = ''
version_suffix = ''
endif
@ -46,7 +44,7 @@ conf.set_quoted('APP_NAME', 'Cassette@0@'.format (name_postfix))
conf.set_quoted('APP_ID_DYN', app_id_dyn)
conf.set_quoted('APP_IDENTITY_DYN', app_identity_dyn)
conf.set_quoted('G_LOG_DOMAIN', app_id)
conf.set_quoted('PROFILE', profile)
conf.set10('IS_DEVEL', get_option('is_devel'))
conf.set_quoted('VERSION', meson.project_version() + version_suffix)
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))

View file

@ -1,10 +1,5 @@
option(
'profile',
type: 'combo',
choices: [
'default',
'development',
],
value: 'default',
description: 'The build profile for app. One of "default" or "development".'
'is_devel',
type: 'boolean',
value: false
)

View file

@ -90,7 +90,7 @@ namespace Cassette {
public bool is_devel {
get {
return Config.PROFILE == "Devel";
return Config.IS_DEVEL;
}
}

View file

@ -4,7 +4,7 @@ namespace Config {
public const string APP_ID_DYN;
public const string APP_IDENTITY_DYN;
public const string VERSION;
public const string PROFILE;
public const bool IS_DEVEL;
public const string GETTEXT_PACKAGE;
public const string GNOMELOCALEDIR;
public const string DATADIR;