meson: check cpu_family() instead of cpu()

meson documents the values returned by cpu_family() as stable,
but not those returned by cpu():
https://mesonbuild.com/Reference-tables.html#cpu-families
https://mesonbuild.com/Reference-manual_builtin_host_machine.html

We already use cpu_family() in most instances, but had missed a few.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2298>
This commit is contained in:
Alan Coopersmith 2026-08-27 09:59:44 -07:00 • committed by Marge Bot
commit 71c7824e80
2 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ srcs_xorg_int10 = [
int10_c_args = [xorg_c_args]
int10_link = []
if host_machine.cpu() == 'i386' or host_machine.cpu() == 'x86_64'
if host_machine.cpu_family() == 'i386' or host_machine.cpu_family() == 'x86_64'
int10_c_args += '-D_PC'
endif

View file

@ -324,10 +324,10 @@ message('IPv6 support: ' + (build_ipv6 ? 'YES' : 'NO'))
int10 = get_option('int10')
if int10 == 'auto'
int10 = 'x86emu'
if host_machine.cpu() == 'ppc' and host_machine.system() == 'freebsd'
if host_machine.cpu_family() == 'ppc' and host_machine.system() == 'freebsd'
int10 = 'stub'
endif
if host_machine.cpu() == 'arm'
if host_machine.cpu_family() == 'arm'
int10 = 'stub'
endif
endif
@ -614,9 +614,9 @@ endif
build_acpi = false
if (get_option('linux_acpi') == true and
host_machine.system() == 'linux')
if (host_machine.cpu() == 'x86' or
host_machine.cpu() == 'x86_64' or
host_machine.cpu() == 'ia64')
if (host_machine.cpu_family() == 'x86' or
host_machine.cpu_family() == 'x86_64' or
host_machine.cpu_family() == 'ia64')
build_acpi = true
endif
endif