aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-09 12:53:10 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-12-13 09:37:47 +0530
commit82a77609e81a513e04fd08a43f0921743a4b1617 (patch)
tree88f59ebe9c39c46d5dcba4a835b81d03feb32f80 /mesonbuild/build.py
parent0fc4ad2a0bc8f60f0c9336a39cf71746d1dab9b9 (diff)
downloadmeson-82a77609e81a513e04fd08a43f0921743a4b1617.zip
meson-82a77609e81a513e04fd08a43f0921743a4b1617.tar.gz
meson-82a77609e81a513e04fd08a43f0921743a4b1617.tar.bz2
Query the target itself for the dynamic linker
This greatly improves the logic for determining the linker. Previously, we would completely break if a target contained only extracted objects and we were using more than one compiler in our project. This also fixes determination of the linker if our target only contains generated objc++ sources, and other funky combinations.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index cc34d57..bfb094e 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -804,6 +804,20 @@ class BuildTarget():
def get_aliaslist(self):
return []
+ def get_clike_dynamic_linker(self):
+ '''
+ We use the order of languages in `clike_langs` to determine which
+ linker to use in case the target has sources compiled with multiple
+ compilers. All languages other than those in this list have their own
+ linker.
+ Note that Vala outputs C code, so Vala sources can use any linker
+ that can link compiled C. We don't actually need to add an exception
+ for Vala here because of that.
+ '''
+ for l in clike_langs:
+ if l in self.compilers:
+ return self.compilers[l]
+
class Generator():
def __init__(self, args, kwargs):