dependencies: cleanup kwargs.get('static') usage

In a couple of spots, kwargs.get('static', False) was being
unneccesarily used. In these spots, we can just use self.static instead
which is already inherited from the ExternalDependency. In additional,
the python system dependency oddly has a kwargs.get('static', False)
line which overrides the self.static in that dependency for no real
reason. Delete this line too.
pull/10325/head
Dudemanguy 3 years ago committed by Eli Schwartz
parent 6c0370f62f
commit 8b3a54e508
  1. 4
      mesonbuild/dependencies/hdf5.py
  2. 1
      mesonbuild/dependencies/misc.py

@ -51,7 +51,7 @@ class HDF5PkgConfigDependency(PkgConfigDependency):
newinc = [] # type: T.List[str] newinc = [] # type: T.List[str]
for arg in self.compile_args: for arg in self.compile_args:
if arg.startswith('-I'): if arg.startswith('-I'):
stem = 'static' if kwargs.get('static', False) else 'shared' stem = 'static' if self.static else 'shared'
if (Path(arg[2:]) / stem).is_dir(): if (Path(arg[2:]) / stem).is_dir():
newinc.append('-I' + str(Path(arg[2:]) / stem)) newinc.append('-I' + str(Path(arg[2:]) / stem))
self.compile_args += newinc self.compile_args += newinc
@ -129,7 +129,7 @@ class HDF5ConfigToolDependency(ConfigToolDependency):
# We first need to call the tool with -c to get the compile arguments # We first need to call the tool with -c to get the compile arguments
# and then without -c to get the link arguments. # and then without -c to get the link arguments.
args = self.get_config_value(['-show', '-c'], 'args')[1:] args = self.get_config_value(['-show', '-c'], 'args')[1:]
args += self.get_config_value(['-show', '-noshlib' if kwargs.get('static', False) else '-shlib'], 'args')[1:] args += self.get_config_value(['-show', '-noshlib' if self.static else '-shlib'], 'args')[1:]
for arg in args: for arg in args:
if arg.startswith(('-I', '-f', '-D')) or arg == '-pthread': if arg.startswith(('-I', '-f', '-D')) or arg == '-pthread':
self.compile_args.append(arg) self.compile_args.append(arg)

@ -196,7 +196,6 @@ class Python3DependencySystem(SystemDependency):
return return
self.name = 'python3' self.name = 'python3'
self.static = kwargs.get('static', False)
# We can only be sure that it is Python 3 at this point # We can only be sure that it is Python 3 at this point
self.version = '3' self.version = '3'
self._find_libpy3_windows(environment) self._find_libpy3_windows(environment)

Loading…
Cancel
Save