From: Ell Date: Mon, 28 Oct 2019 05:59:34 +0000 (+0200) Subject: meson: improve host cpu detection X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~10^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c036eba207045966607bd5cf3d66132ec755eb6d;p=babl.git meson: improve host cpu detection See gegl@6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8. --- diff --git a/meson.build b/meson.build index bd428b6..0befaef 100644 --- a/meson.build +++ b/meson.build @@ -80,31 +80,24 @@ platform_android = false platform_osx = false platform_win32 = false -host_cpu = host_machine.cpu() -message('Architecture: ' + host_cpu) +host_cpu_family = host_machine.cpu_family() +message('Host machine cpu family: ' + host_cpu_family) -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 - conf.set10('ARCH_X86', true, description: - 'Define to 1 if you are compiling for ix86.') -elif host_cpu == 'x86_64' + conf.set10('ARCH_X86', true) +elif host_cpu_family == 'x86_64' have_x86 = true - conf.set10('ARCH_X86', true, description: - 'Define to 1 if you are compiling for ix86.') - conf.set10('ARCH_X86_64', true, description: - 'Define to 1 if you are compiling for amd64.') -elif host_cpu == 'ppc' or host_cpu == 'powerpc' + conf.set10('ARCH_X86', true) + conf.set10('ARCH_X86_64', true) +elif host_cpu_family == 'ppc' have_ppc = true - conf.set10('ARCH_PPC', true, description: - 'Define to 1 if you are compiling for PowerPC.') -elif host_cpu == 'ppc64' or host_cpu == 'powerpc64' + conf.set10('ARCH_PPC', true) +elif host_cpu_family == 'ppc64' have_ppc = true - conf.set10('ARCH_PPC', true, description: - 'Define to 1 if you are compiling for PowerPC.') - conf.set10('ARCH_PPC64', true, description: - 'Define to 1 if you are compiling for PowerPC64.') -else - warning('Unknown host architecture') + conf.set10('ARCH_PPC', true) + conf.set10('ARCH_PPC64', true) endif host_os = host_machine.system()