Revert "build: don't add targets to link_whole_targets if we took their objects"

This reverts commit c94c492089.

This broke propagated deps as well as PCH in MSVC, and has not been
fixed in time for the final release of 0.64.0, so it needs to be
reverted and then brought back later.

Fixes #10745
Fixes #10975
pull/10976/head
Eli Schwartz 2 years ago
parent 81763e610f
commit 4533dfc279
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 8
      mesonbuild/build.py

@ -1403,13 +1403,11 @@ 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()
else:
self.link_whole_targets.append(t)
self.link_whole_targets.append(t)
def extract_all_objects_recurse(self) -> T.List[T.Union[str, 'ExtractedObjects']]:
objs = [self.extract_all_objects()]

Loading…
Cancel
Save