@FeatureNew('meson.override_dependency', '0.54.0')
@permittedKwargs({'native'})
def override_dependency_method(self, args, kwargs):
    if (len(args) != 2):
        raise InterpreterException('Override needs two arguments')
    name = args[0]
    dep = args[1]
    if ((not isinstance(name, str)) or (not name)):
        raise InterpreterException('First argument must be a string and cannot be empty')
    if hasattr(dep, 'held_object'):
        dep = dep.held_object
    if (not isinstance(dep, dependencies.Dependency)):
        raise InterpreterException('Second argument must be a dependency object')
    identifier = dependencies.get_dep_identifier(name, kwargs)
    for_machine = self.interpreter.machine_from_native_kwarg(kwargs)
    override = self.build.dependency_overrides[for_machine].get(identifier)
    if override:
        m = 'Tried to override dependency {!r} which has already been resolved or overridden at {}'
        location = mlog.get_error_location_string(override.node.filename, override.node.lineno)
        raise InterpreterException(m.format(name, location))
    self.build.dependency_overrides[for_machine][identifier] = build.DependencyOverride(dep, self.interpreter.current_node)
@FeatureNew('meson.override_dependency', '0.54.0')
@permittedKwargs({'native'})
def override_dependency_method(self, args, kwargs):
    if (len(args) != 2):
        raise InterpreterException('Override needs two arguments')
    name = args[0]
    dep = args[1]
    if ((not isinstance(name, str)) or (not name)):
        raise InterpreterException('First argument must be a string and cannot be empty')
    if hasattr(dep, 'held_object'):
        dep = dep.held_object
    if (not isinstance(dep, dependencies.Dependency)):
        raise InterpreterException('Second argument must be a dependency object')
    identifier = dependencies.get_dep_identifier(name, kwargs)
    for_machine = self.interpreter.machine_from_native_kwarg(kwargs)
    override = self.build.dependency_overrides[for_machine].get(identifier)
    if override:
        m = 'Tried to override dependency {!r} which has already been resolved or overridden at {}'
        location = mlog.get_error_location_string(override.node.filename, override.node.lineno)
        raise InterpreterException(m.format(name, location))
    self.build.dependency_overrides[for_machine][identifier] = build.DependencyOverride(dep, self.interpreter.current_node)