From fd892ad7cec12a34287f65a57c44703a6f4e4119 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 8 Jan 2020 13:23:52 -0800 Subject: dependencies: Make Dependency initializer signatures match Currently PkgConfig takes language as a keyword parameter in position 3, while the others take it as positional in position 2. Because most dependencies don't actually set a language (they use C style linking), using a positional argument makes more sense. ExtraFrameworkDependencies is even more different, and duplicates some arguments from the base ExternalDependency class. For later changes I'm planning to make having all of the dependencies use the same signature is really, really helpful. --- mesonbuild/dependencies/dev.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/dependencies/dev.py') diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index 0488b2b..da19e90 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -46,7 +46,7 @@ def get_shared_library_suffix(environment, for_machine: MachineChoice): class GTestDependency(ExternalDependency): def __init__(self, environment, kwargs): - super().__init__('gtest', environment, 'cpp', kwargs) + super().__init__('gtest', environment, kwargs, language='cpp') self.main = kwargs.get('main', False) self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src'] self.detect() @@ -119,7 +119,7 @@ class GTestDependency(ExternalDependency): class GMockDependency(ExternalDependency): def __init__(self, environment, kwargs): - super().__init__('gmock', environment, 'cpp', kwargs) + super().__init__('gmock', environment, kwargs, language='cpp') self.main = kwargs.get('main', False) self._add_sub_dependency(ThreadDependency, environment, kwargs) @@ -218,7 +218,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency): # It's necessary for LLVM <= 3.8 to use the C++ linker. For 3.9 and 4.0 # the C linker works fine if only using the C API. - super().__init__('LLVM', environment, 'cpp', kwargs) + super().__init__('LLVM', environment, kwargs, language='cpp') self.provided_modules = [] self.required_modules = set() self.module_details = [] @@ -394,7 +394,7 @@ class LLVMDependencyCMake(CMakeDependency): def __init__(self, env, kwargs): self.llvm_modules = stringlistify(extract_as_list(kwargs, 'modules')) self.llvm_opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules')) - super().__init__(name='LLVM', environment=env, language='cpp', kwargs=kwargs) + super().__init__('LLVM', env, kwargs, language='cpp') if self.traceparser is None: return @@ -435,7 +435,7 @@ class LLVMDependencyCMake(CMakeDependency): class LLVMDependency(ExternalDependency): def __init__(self, env, kwargs): - super().__init__('LLVM', env, 'cpp', kwargs) + super().__init__('LLVM', env, kwargs, language='cpp') @classmethod def _factory(cls, env, kwargs): -- cgit v1.1