summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-03-12 12:21:21 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2019-03-14 23:35:26 +0200
commit914056f68af59f358ab1f45b3ceab79c42de0c12 (patch)
tree53b06cc470586d5df3f68dd080d7f7ccc089394d
parentbcee8fb8caa693e7cd277fc122a61071f8964fa3 (diff)
downloadmeson-914056f68af59f358ab1f45b3ceab79c42de0c12.tar.gz
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.
-rw-r--r--mesonbuild/envconfig.py13
1 files changed, 13 insertions, 0 deletions
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__: