aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-09-25 10:57:49 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-09-26 19:48:46 +0530
commitac8c8c2ba8244714702fdc6c7ee2362c5a05c034 (patch)
treef557fe0f244ad7652e46812a1e6cba27d21342e1 /mesonbuild/interpreter.py
parent6590b7221e1e3a30b33a6b74b380ee5a2b24d7ef (diff)
downloadmeson-ac8c8c2ba8244714702fdc6c7ee2362c5a05c034.zip
meson-ac8c8c2ba8244714702fdc6c7ee2362c5a05c034.tar.gz
meson-ac8c8c2ba8244714702fdc6c7ee2362c5a05c034.tar.bz2
Treat 32-bit compiles on 64-bit Windows as native
It's a terrible user experience to force people building 32-bit applications on 64-bit Windows to use a cross-info file when every other tool treats it as a 'native' compilation -- it satisfies all the requirements for a native compile. This commit also fixes the platform detection on Windows which would cause the 'native cpu' to be detected as 32-bit if you installed 32-bit Python on 64-bit Windows, or if you were building with a 32-bit toolchain on 64-bit Windows. Doesn't support MinGW yet -- the next commits will add that since the changes required for that are more involved.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 0f00c5a..4412ffe 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -375,7 +375,8 @@ class GeneratedListHolder(InterpreterObject):
self.held_object.add_file(a)
class BuildMachine(InterpreterObject):
- def __init__(self):
+ def __init__(self, compilers):
+ self.compilers = compilers
InterpreterObject.__init__(self)
self.methods.update({'system' : self.system_method,
'cpu_family' : self.cpu_family_method,
@@ -384,10 +385,10 @@ class BuildMachine(InterpreterObject):
})
def cpu_family_method(self, args, kwargs):
- return environment.detect_cpu_family()
+ return environment.detect_cpu_family(self.compilers)
def cpu_method(self, args, kwargs):
- return environment.detect_cpu()
+ return environment.detect_cpu(self.compilers)
def system_method(self, args, kwargs):
return environment.detect_system()
@@ -1099,7 +1100,7 @@ class Interpreter():
self.variables = {}
self.builtin = {}
self.parse_project()
- self.builtin['build_machine'] = BuildMachine()
+ self.builtin['build_machine'] = BuildMachine(self.coredata.compilers)
if not self.build.environment.is_cross_build():
self.builtin['host_machine'] = self.builtin['build_machine']
self.builtin['target_machine'] = self.builtin['build_machine']