]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: convert developer_mode boolean to an enum
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Oct 2020 08:04:23 +0000 (10:04 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Oct 2020 09:05:17 +0000 (11:05 +0200)
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.

man/meson.build
meson.build
meson_options.txt
src/basic/build.h
src/basic/missing_capability.h

index 3c2c7023ed08f325a22b3ed50b4cabba367176e4..d056ad0c71f0537eb53184f28e3c4aeb62db579e 100644 (file)
@@ -207,7 +207,7 @@ if dbus_docs.length() > 0
                            '@INPUT@'],
                 input : dbus_docs)
 
-        if conf.get('DEVELOPER_MODE') == 1
+        if conf.get('BUILD_MODE') == 'BUILD_MODE_DEVELOPER'
                 test('dbus-docs-fresh',
                      update_dbus_docs_py,
                      args : ['--build-dir=@0@'.format(project_build_root),
index 7c2d4e8b10844768199384ff4df61df1c42a2166..307d1bd5f7c30461cd51585305ae79d2af28d584 100644 (file)
@@ -38,8 +38,8 @@ relative_source_path = run_command('realpath',
                                    project_source_root).stdout().strip()
 conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
 
-conf.set10('DEVELOPER_MODE', get_option('mode') == 'developer',
-           description : 'enable additional checks only suitable in development')
+conf.set('BUILD_MODE', 'BUILD_MODE_' + get_option('mode').to_upper(),
+         description : 'tailor build to development or release builds')
 
 want_ossfuzz = get_option('oss-fuzz')
 want_libfuzzer = get_option('llvm-fuzz')
index 59248c70999f1e1dcec2a99da07a275d0d4d8ab2..2c10054769fcea2e2fe1b2b97be119e4d4fc07d0 100644 (file)
@@ -5,7 +5,7 @@ option('version-tag', type : 'string',
        description : 'override the git version string')
 
 option('mode', type : 'combo', choices : ['developer', 'release'],
-       description : 'enable additional checks suitable for systemd development')
+       description : 'autoenable features suitable for systemd development/release builds')
 
 option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
        description : '''/bin, /sbin aren't symlinks into /usr''')
index d160af5bc7e6d7e6101c73d54853eb3c37270877..e02ad391a96abae4db1433f595b61cc1067bf299 100644 (file)
         _IDN_FEATURE_ " "                                               \
         _PCRE2_FEATURE_ " "                                             \
         _CGROUP_HIERARCHY_
+
+enum {
+        BUILD_MODE_DEVELOPER,
+        BUILD_MODE_RELEASE,
+};
index c52cd449339cad29df48a629ccc5eb824cc614ad..4d37618741f741052f66ba29b5bff6260ed96f3e 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifdef CAP_LAST_CAP
 #  if CAP_LAST_CAP > SYSTEMD_CAP_LAST_CAP
-#    if DEVELOPER_MODE && defined(TEST_CAPABILITY_C)
+#    if BUILD_MODE == BUILD_MODE_DEVELOPER && defined(TEST_CAPABILITY_C)
 #      warning "The capability list here is outdated"
 #    endif
 #  else