]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: introduce HAVE_DMI flag
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jul 2023 21:32:53 +0000 (06:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 3 Aug 2023 11:37:16 +0000 (20:37 +0900)
The condition is used at several places. Let's introduce a simple flag
for that.

meson.build
rules.d/meson.build
src/udev/meson.build
test/meson.build

index 8dcc8ead4a07962706e76cf7e37e04c68645d042..430457bb1edd334c64fa3d232c549ecb87e3596c 100644 (file)
@@ -1689,6 +1689,9 @@ if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes'
         endif
 endif
 
+dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips']
+conf.set10('HAVE_DMI', host_machine.cpu_family() in dmi_arches)
+
 # We support one or the other. If gcrypt is available, we assume it's there to
 # be used, and use it in preference.
 opt = get_option('cryptolib')
@@ -3166,6 +3169,7 @@ foreach tuple : [
         ['xdg-autostart'],
 
         # optional features
+        ['dmi'],
         ['idn'],
         ['polkit'],
         ['nscd'],
index 20fca222da6b9fb7a0bbeee18551b8130e983104..13f25397dcde3554b62a0644ff50b6c94050caaa 100644 (file)
@@ -36,7 +36,7 @@ rules = [
          conf.get('HAVE_KMOD') == 1],
 
         [files('70-memory.rules'),
-         dmi_arches.contains(host_machine.cpu_family())],
+         conf.get('HAVE_DMI') == 1],
 
         [files('70-power-switch.rules'),
          enable_logind],
index 932a7186515e91b69d92a0ae190078e8b0451c23..2c100959412b3248895383ca2dbcb5c68672ee17 100644 (file)
@@ -144,8 +144,7 @@ udev_progs = [['ata_id/ata_id.c'],
               ['mtd_probe/mtd_probe.c',
                'mtd_probe/probe_smartmedia.c']]
 
-dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips']
-if dmi_arches.contains(host_machine.cpu_family())
+if conf.get('HAVE_DMI') == 1
         udev_progs += [['dmi_memory_id/dmi_memory_id.c']]
 endif
 
index f41c01fa3513d39c6d02a923c449eb3accd2d58e..d57736e739d8822b895d3553e60932a878d0ef73 100644 (file)
@@ -256,7 +256,7 @@ endif
 
 ############################################################
 
-if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
+if want_tests != 'false' and conf.get('HAVE_DMI') == 1
         udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
 
         if git.found() and fs.is_dir(project_source_root / '.git')