Skip to content

Commit b8ee349

Browse files
committed
meson: convert developer_mode boolean to an enum
I initially changed this to add a third state. But even with two values having an explicit name instead of just 0/1 is mode descriptive.
1 parent 4cce6f2 commit b8ee349

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

man/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ if dbus_docs.length() > 0
207207
'@INPUT@'],
208208
input : dbus_docs)
209209

210-
if conf.get('DEVELOPER_MODE') == 1
210+
if conf.get('BUILD_MODE') == 'BUILD_MODE_DEVELOPER'
211211
test('dbus-docs-fresh',
212212
update_dbus_docs_py,
213213
args : ['--build-dir=@0@'.format(project_build_root),

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ relative_source_path = run_command('realpath',
3838
project_source_root).stdout().strip()
3939
conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
4040

41-
conf.set10('DEVELOPER_MODE', get_option('mode') == 'developer',
42-
description : 'enable additional checks only suitable in development')
41+
conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(),
42+
description : 'tailor build to development or release builds')
4343

4444
want_ossfuzz = get_option('oss-fuzz')
4545
want_libfuzzer = get_option('llvm-fuzz')

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ option('version-tag', type : 'string',
55
description : 'override the git version string')
66

77
option('mode', type : 'combo', choices : ['developer', 'release'],
8-
description : 'enable additional checks suitable for systemd development')
8+
description : 'autoenable features suitable for systemd development/release builds')
99

1010
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
1111
description : '''/bin, /sbin aren't symlinks into /usr''')

src/basic/build.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,8 @@
161161
_IDN_FEATURE_ " " \
162162
_PCRE2_FEATURE_ " " \
163163
_CGROUP_HIERARCHY_
164+
165+
enum {
166+
BUILD_MODE_DEVELOPER,
167+
BUILD_MODE_RELEASE,
168+
};

src/basic/missing_capability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#ifdef CAP_LAST_CAP
2929
# if CAP_LAST_CAP > SYSTEMD_CAP_LAST_CAP
30-
# if DEVELOPER_MODE && defined(TEST_CAPABILITY_C)
30+
# if BUILD_MODE == BUILD_MODE_DEVELOPER && defined(TEST_CAPABILITY_C)
3131
# warning "The capability list here is outdated"
3232
# endif
3333
# else

0 commit comments

Comments
 (0)