From 2fd5bd934e0e6dd26ad8c326a156a710f912b335 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 8 Dec 2022 10:22:35 -0800 Subject: [PATCH] interpreter: use static_lib's already calculated pic value Instead of re-calculating it when building both libraries --- mesonbuild/interpreter/interpreter.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 44b2e7235cec..f112e4e8fc42 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -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 @@ -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