1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

meson: introduce HAVE_DMI flag

The condition is used at several places. Let's introduce a simple flag
for that.
This commit is contained in:
Yu Watanabe 2023-07-30 06:32:53 +09:00
parent ff2dedcffd
commit 12b4cffdae
4 changed files with 7 additions and 4 deletions

View 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'],

View 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],

View 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

View 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')