From 914056f68af59f358ab1f45b3ceab79c42de0c12 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 12 Mar 2019 12:21:21 -0700 Subject: [PATCH] envconfig: Store whether the cpu_familiy is 64 bit We'll need this in the llvm-config logic to determine the right llvm-config to call on Fedora 30+, but this feels like the sort of information that might be useful elsewhere. This does not expose this information as part of the public API, it's only accessible at the python layer. --- mesonbuild/envconfig.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index f2510c1aa..609899c23 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -55,6 +55,18 @@ known_cpu_families = ( 'x86_64' ) +# It would feel more natural to call this "64_BIT_CPU_FAMILES", but +# python identifiers cannot start with numbers +CPU_FAMILES_64_BIT = [ + 'aarch64', + 'ia64', + 'mips64', + 'ppc64', + 'riscv64', + 'sparc64', + 'x86_64', +] + class MesonConfigFile: @classmethod def parse_datafile(cls, filename): @@ -150,6 +162,7 @@ class MachineInfo: self.cpu_family = cpu_family self.cpu = cpu self.endian = endian + self.is_64_bit = cpu_family in CPU_FAMILES_64_BIT def __eq__(self, other): if self.__class__ is not other.__class__: