diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-15 20:20:38 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-10-18 01:08:04 +0300 |
commit | 572ce0f4519488840d466befde6bb38ccb044e40 (patch) | |
tree | 122b04efd982683829ca5678e6ab5e5ee4cc274d /interpreter.py | |
parent | 1c186d4a300f4e0d4355d9ce1f5c16af54d27dd9 (diff) | |
download | meson-572ce0f4519488840d466befde6bb38ccb044e40.zip meson-572ce0f4519488840d466befde6bb38ccb044e40.tar.gz meson-572ce0f4519488840d466befde6bb38ccb044e40.tar.bz2 |
Added cpu family property to system information.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/interpreter.py b/interpreter.py index 70ce271..8cb272c 100644 --- a/interpreter.py +++ b/interpreter.py @@ -308,6 +308,7 @@ class BuildMachine(InterpreterObject): def __init__(self): InterpreterObject.__init__(self) self.methods.update({'system' : self.system_method, + 'cpu_family' : self.cpu_family_method, 'cpu' : self.cpu_method, 'endian' : self.endian_method, }) @@ -316,18 +317,18 @@ class BuildMachine(InterpreterObject): # It returns different values for the same cpu. # For x86 it might return 'x86', 'i686' or somesuch. # Do some canonicalization. - def cpu_method(self, args, kwargs): + def cpu_family_method(self, args, kwargs): trial = platform.machine().lower() if trial.startswith('i') and trial.endswith('86'): return 'x86' - # This might be wrong. Maybe we should return the more - # specific string such as 'armv7l'. Need to get user - # feedback first. if trial.startswith('arm'): return 'arm' # Add fixes here as bugs are reported. return trial + def cpu_method(self, args, kwargs): + return platform.machine().lower() + def system_method(self, args, kwargs): return platform.system().lower() @@ -342,6 +343,7 @@ class CrossMachineInfo(InterpreterObject): self.info = cross_info self.methods.update({'system' : self.system_method, 'cpu' : self.cpu_method, + 'cpu_family' : self.cpu_family_method, 'endian' : self.endian_method, }) @@ -351,6 +353,9 @@ class CrossMachineInfo(InterpreterObject): def cpu_method(self, args, kwargs): return self.info['cpu'] + def cpu_family_method(self, args, kwargs): + return self.info['cpu_family'] + def endian_method(self, args, kwargs): return self.info['endian'] |