aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-06 01:17:25 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-06 10:14:43 -0800
commit8d182e00c9dae45c8abe2df7e0c347fc5ce7deef (patch)
tree2b36db8869f8b63c88651c7e5706d39ad0819c53
parent335d2633159af139d0495863fbf6ef05f88ba6ac (diff)
downloadmeson-8d182e00c9dae45c8abe2df7e0c347fc5ce7deef.zip
meson-8d182e00c9dae45c8abe2df7e0c347fc5ce7deef.tar.gz
meson-8d182e00c9dae45c8abe2df7e0c347fc5ce7deef.tar.bz2
Use a cross linker when cross compiling.
-rw-r--r--mesonbuild/backend/backends.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index e91b44b..a4f2b51 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -236,19 +236,23 @@ class Backend():
def determine_linker(self, target, src):
if isinstance(target, build.StaticLibrary):
- if self.build.static_cross_linker is not None:
+ if target.is_cross:
return self.build.static_cross_linker
else:
return self.build.static_linker
- if len(self.build.compilers) == 1:
- return self.build.compilers[0]
+ if target.is_cross:
+ compilers = self.build.cross_compilers
+ else:
+ compilers = self.build.compilers
+ if len(compilers) == 1:
+ return compilers[0]
# Currently a bit naive. C++ must
# be linked with a C++ compiler, but
# otherwise we don't care. This will
# become trickier if and when Fortran
# and the like become supported.
cpp = None
- for c in self.build.compilers:
+ for c in compilers:
if c.get_language() == 'cpp':
cpp = c
break
@@ -256,7 +260,7 @@ class Backend():
for s in src:
if c.can_compile(s):
return cpp
- for c in self.build.compilers:
+ for c in compilers:
if c.get_language() == 'vala':
continue
for s in src: