aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-09-18 21:12:55 -0400
committerXavier Claessens <xclaesse@gmail.com>2019-10-01 13:06:45 -0400
commitf396c71c52a7a3589c2998fce000843fc1e73835 (patch)
treec2790166411a7b1d657c825d9b7197abf00d4049 /mesonbuild/build.py
parent01569fee2e8130b3ac54659c119e73180d3dafee (diff)
downloadmeson-f396c71c52a7a3589c2998fce000843fc1e73835.zip
meson-f396c71c52a7a3589c2998fce000843fc1e73835.tar.gz
meson-f396c71c52a7a3589c2998fce000843fc1e73835.tar.bz2
Fix link_whole of static libraries
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index e18e7ae..49d53c0 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1099,7 +1099,15 @@ You probably should put it in link_with instead.''')
raise InvalidArguments(msg + ' This is not possible in a cross build.')
else:
mlog.warning(msg + ' This will fail in cross build.')
- self.link_whole_targets.append(t)
+ if isinstance(self, StaticLibrary):
+ # When we're a static library and we link_whole: to another static
+ # library, we need to add that target's objects to ourselves.
+ self.objects.append(t.extract_all_objects())
+ # Add internal and external deps
+ self.external_deps += t.external_deps
+ self.link_targets += t.link_targets
+ else:
+ self.link_whole_targets.append(t)
def add_pch(self, language, pchlist):
if not pchlist: