Add get_variable() system dependency

pull/13703/head
unknown 2 months ago committed by Dylan Baker
parent 3f4957c713
commit c8b463491c
  1. 4
      mesonbuild/dependencies/base.py
  2. 2
      mesonbuild/dependencies/cmake.py
  3. 2
      mesonbuild/dependencies/configtool.py
  4. 2
      mesonbuild/dependencies/pkgconfig.py
  5. 2
      mesonbuild/interpreter/interpreterobjects.py
  6. 1
      mesonbuild/interpreter/kwargs.py

@ -237,7 +237,7 @@ class Dependency(HoldableObject):
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,
system: T.Optional[str] = None, default_value: T.Optional[str] = None,
pkgconfig_define: PkgConfigDefineType = None) -> str:
if default_value is not None:
return default_value
@ -329,7 +329,7 @@ class InternalDependency(Dependency):
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,
system: T.Optional[str] = None, default_value: T.Optional[str] = None,
pkgconfig_define: PkgConfigDefineType = None) -> str:
val = self.variables.get(internal, default_value)
if val is not None:

@ -617,7 +617,7 @@ class CMakeDependency(ExternalDependency):
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,
system: T.Optional[str] = None, default_value: T.Optional[str] = None,
pkgconfig_define: PkgConfigDefineType = None) -> str:
if cmake and self.traceparser is not None:
try:

@ -150,7 +150,7 @@ class ConfigToolDependency(ExternalDependency):
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,
system: T.Optional[str] = None, default_value: T.Optional[str] = None,
pkgconfig_define: PkgConfigDefineType = None) -> str:
if configtool:
p, out, _ = Popen_safe(self.config + self.get_variable_args(configtool))

@ -557,7 +557,7 @@ class PkgConfigDependency(ExternalDependency):
def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[str] = None,
configtool: T.Optional[str] = None, internal: T.Optional[str] = None,
default_value: T.Optional[str] = None,
system: T.Optional[str] = None, default_value: T.Optional[str] = None,
pkgconfig_define: PkgConfigDefineType = None) -> str:
if pkgconfig:
try:

@ -545,6 +545,7 @@ class DependencyHolder(ObjectHolder[Dependency]):
KwargInfo('pkgconfig', (str, NoneType)),
KwargInfo('configtool', (str, NoneType)),
KwargInfo('internal', (str, NoneType), since='0.54.0'),
KwargInfo('system', (str, NoneType), since='1.6.0'),
KwargInfo('default_value', (str, NoneType)),
PKGCONFIG_DEFINE_KW,
)
@ -561,6 +562,7 @@ class DependencyHolder(ObjectHolder[Dependency]):
pkgconfig=kwargs['pkgconfig'] or default_varname,
configtool=kwargs['configtool'] or default_varname,
internal=kwargs['internal'] or default_varname,
system=kwargs['system'] or default_varname,
default_value=kwargs['default_value'],
pkgconfig_define=kwargs['pkgconfig_define'],
)

@ -268,6 +268,7 @@ class DependencyGetVariable(TypedDict):
pkgconfig: T.Optional[str]
configtool: T.Optional[str]
internal: T.Optional[str]
system: T.Optional[str]
default_value: T.Optional[str]
pkgconfig_define: PkgConfigDefineType

Loading…
Cancel
Save