Skip to content

Commit

Permalink
cargo: A dependency is required if a feature with same name is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
xclaesse committed Mar 4, 2024
1 parent f7621ee commit cf0224b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mesonbuild/cargo/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,10 @@ def _create_dependency(name: str, dep: Dependency, build: builder.Builder) -> T.
'default_options': build.identifier(_options_varname(name)),
}
if dep.optional:
kw['required'] = build.method('get', build.identifier('required_deps'), [
build.string(name), build.bool(False)
])
kw['required'] = build.or_(
build.method('get', build.identifier('required_deps'), [build.string(name), build.bool(False)]),
build.method('get', build.identifier('features'), [build.string(name), build.bool(False)]),
)

# Lookup for this dependency with the features we want in default_options kwarg.
#
Expand Down

0 comments on commit cf0224b

Please sign in to comment.