From 82a77609e81a513e04fd08a43f0921743a4b1617 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 9 Dec 2016 12:53:10 +0530 Subject: 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. --- mesonbuild/build.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mesonbuild/build.py') 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): -- cgit v1.1