Skip to content

Commit d63c0ba

Browse files
committed
interpreter: add static_lib objects to shared_lib in build_both
This makes more sense if we can re-use the object files anyway. It might make sense eventually to just convert this to create the shared_lib by `link_whole` with the `static_lib` in the case of reusable files. THis might also fix the xcode problem
1 parent c1d579c commit d63c0ba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mesonbuild/interpreter/interpreter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,16 +3054,16 @@ def build_both_libraries(self, node, args, kwargs):
30543054
reuse_object_files = static_lib.pic
30553055

30563056
if reuse_object_files:
3057-
# Replace sources with objects from the shared library to avoid
3058-
# building them twice. We post-process the static library instead of
3057+
# Replace sources with objects from the static library to avoid
3058+
# building them twice. We post-process the shared library instead of
30593059
# removing sources from args because sources could also come from
30603060
# any InternalDependency, see BuildTarget.add_deps().
3061-
static_lib.objects.append(build.ExtractedObjects(shared_lib, shared_lib.sources, shared_lib.generated, []))
3062-
static_lib.sources = []
3063-
static_lib.generated = []
3061+
shared_lib.objects.append(build.ExtractedObjects(static_lib, static_lib.sources, static_lib.generated, []))
3062+
shared_lib.sources = []
3063+
shared_lib.generated = []
30643064
# Compilers with no corresponding sources confuses the backend.
30653065
# Keep only compilers used for linking
3066-
static_lib.compilers = {k: v for k, v in static_lib.compilers.items() if k in compilers.clink_langs}
3066+
shared_lib.compilers = {k: v for k, v in shared_lib.compilers.items() if k in compilers.clink_langs}
30673067

30683068
return build.BothLibraries(shared_lib, static_lib)
30693069

0 commit comments

Comments
 (0)