Commit 6bcf95fd authored by Christoph Reiter's avatar Christoph Reiter 🐍

meson: fix cpu detection

Use host_machine.cpu_family() instead of cpu(). Only the former
provides a stable/defined set of values.

Also don't error out on some arches for no good reason.

This fixes the build on 32bit Windows.
parent 5052f5b2
Pipeline #126402 passed with stages
in 7 minutes and 51 seconds
......@@ -73,23 +73,21 @@ if os_osx and cc.get_id() != 'clang'
endif
host_cpu = host_machine.cpu()
if host_cpu.startswith('i') and host_cpu.endswith('86')
host_cpu_family = host_machine.cpu_family()
if host_cpu_family == 'x86'
have_x86 = true
config.set10('ARCH_X86', true)
elif host_cpu == 'x86_64'
elif host_cpu_family == 'x86_64'
have_x86 = true
config.set10('ARCH_X86', true)
config.set10('ARCH_X86_64', true)
elif host_cpu == 'ppc' or host_cpu == 'powerpc'
elif host_cpu_family == 'ppc'
have_ppc = true
config.set10('ARCH_PPC', true)
elif host_cpu == 'ppc64' or host_cpu == 'powerpc64'
elif host_cpu_family == 'ppc64'
have_ppc = true
config.set10('ARCH_PPC', true)
config.set10('ARCH_PPC64', true)
else
error('Unknown host architecture')
endif
################################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment