Skip to content

Commit

Permalink
interpreter: use static_lib's already calculated pic value
Browse files Browse the repository at this point in the history
Instead of re-calculating it when building both libraries
  • Loading branch information
dcbaker committed Dec 24, 2022
1 parent 8e2355e commit 2fd5bd9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3042,14 +3042,6 @@ def build_both_libraries(self, node, args, kwargs):
shared_lib = self.build_target(node, args, kwargs, build.SharedLibrary)
static_lib = self.build_target(node, args, kwargs, build.StaticLibrary)

# Check if user forces non-PIC static library.
pic = True
key = OptionKey('b_staticpic')
if 'pic' in kwargs:
pic = kwargs['pic']
elif key in self.environment.coredata.options:
pic = self.environment.coredata.options[key].value

if self.backend.name == 'xcode':
# Xcode is a bit special in that you can't (at least for the moment)
# form a library only from object file inputs. The simple but inefficient
Expand All @@ -3059,7 +3051,7 @@ def build_both_libraries(self, node, args, kwargs):
# issue for you.
reuse_object_files = False
else:
reuse_object_files = pic
reuse_object_files = static_lib.pic

if reuse_object_files:
# Replace sources with objects from the shared library to avoid
Expand Down

0 comments on commit 2fd5bd9

Please sign in to comment.