diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-06-10 16:07:21 -0400 |
|---|---|---|
| committer | Xavier Claessens <xavier.claessens@collabora.com> | 2024-02-26 10:03:52 -0500 |
| commit | 114e032e6a27d0eb9ef5de1a811ce7b0461c3efc (patch) | |
| tree | f20b3b240b4cb32ba54644bd7388e97038311dfc /docs | |
| parent | d075bdb3ca39a077994fa65e7fafb98cdebf5da6 (diff) | |
| download | meson-114e032e6a27d0eb9ef5de1a811ce7b0461c3efc.tar.gz | |
cargo: Expose features as Meson boolean options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/markdown/Wrap-dependency-system-manual.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/markdown/Wrap-dependency-system-manual.md b/docs/markdown/Wrap-dependency-system-manual.md index e1e947479..7a0cea6fe 100644 --- a/docs/markdown/Wrap-dependency-system-manual.md +++ b/docs/markdown/Wrap-dependency-system-manual.md @@ -335,6 +335,26 @@ method = cargo dependency_names = foo-bar-rs ``` +Cargo features are exposed as Meson boolean options, with the `feature-` prefix. +For example the `default` feature is named `feature-default` and can be set from +the command line with `-Dfoo-rs:feature-default=false`. When a cargo subproject +depends on another cargo subproject, it will automatically enable features it +needs using the `dependency('foo-rs', default_options: ...)` mechanism. However, +unlike Cargo, the set of enabled features is not managed globally. Let's assume +the main project depends on `foo-rs` and `bar-rs`, and they both depend on +`common-rs`. The main project will first look up `foo-rs` which itself will +configure `common-rs` with a set of features. Later, when `bar-rs` does a lookup +for `common-rs` it has already been configured and the set of features cannot be +changed. It is currently the responsability of the main project to resolve those +issues by enabling extra features on each subproject: +```meson +project(..., + default_options: { + 'common-rs:feature-something': true, + }, +) +``` + ## Using wrapped projects Wraps provide a convenient way of obtaining a project into your |
