aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/build.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 28d503f..9b44f1a 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1466,11 +1466,13 @@ 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.')
+ # When we're a static library and we link_whole: to another static
+ # library, we need to add that target's objects to ourselves.
+ # Otherwise add it to the link_whole_targets, but not both.
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 += t.extract_all_objects_recurse()
- self.link_whole_targets.append(t)
+ else:
+ self.link_whole_targets.append(t)
def extract_all_objects_recurse(self) -> T.List[T.Union[str, 'ExtractedObjects']]:
objs = [self.extract_all_objects()]