@@ -144,6 +144,73 @@ allow_feature_sets = [
144144# When enabled, never include the empty feature set (no `--features`), even if
145145# it would otherwise be generated.
146146no_empty_feature_set = true
147+
148+ # Optional: additional metadata merged into `cargo fc matrix` output
149+ matrix = { kind = " ci" }
150+ ```
151+
152+ #### Target-specific configuration
153+
154+ You can override configuration for specific targets using Cargo-style ` cfg(...) ` expressions.
155+ Overrides are configured under:
156+
157+ ``` toml
158+ [package .metadata .cargo-feature-combinations .target .'cfg( ...)' ]
159+ ```
160+
161+ Example (exclude different features per OS):
162+
163+ ``` toml
164+ [package .metadata .cargo-feature-combinations ]
165+ exclude_features = [" default" ]
166+
167+ [package .metadata .cargo-feature-combinations .target .'cfg(target_os = "linux")' ]
168+ exclude_features = { add = [" metal" ] }
169+
170+ [package .metadata .cargo-feature-combinations .target .'cfg(target_os = "macos")' ]
171+ exclude_features = { add = [" cuda" ] }
172+ ```
173+
174+ Patch semantics for collection-like keys such as ` exclude_features ` , ` include_features ` ,
175+ ` only_features ` , ` *_feature_sets ` :
176+
177+ - ** Array syntax is always an override**
178+ - ` exclude_features = ["cuda"] ` replaces the entire value.
179+ - This is equivalent to ` exclude_features = { override = ["cuda"] } ` .
180+ - ** Patch object syntax is explicit**
181+ - Override (replace the entire value):
182+ - ` exclude_features = { override = ["cuda"] } `
183+ - Add (union with the base value):
184+ - ` exclude_features = { add = ["cuda"] } `
185+ - Remove (subtract from the base value):
186+ - ` exclude_features = { remove = ["cuda"] } `
187+
188+ When multiple target override sections match (e.g. ` cfg(unix) ` and ` cfg(target_os = "linux") ` ),
189+ they are merged deterministically. Conflicting ` override ` values result in an error.
190+
191+ ##### ` replace = true `
192+
193+ If a matching target override sets ` replace = true ` , resolution starts from a fresh default
194+ configuration (instead of inheriting from the base config). To avoid confusion, when
195+ ` replace = true ` is set, patchable fields must not use ` add ` or ` remove ` (only override
196+ is allowed).
197+
198+ Example (using array shorthand, i.e. override):
199+
200+ ``` toml
201+ [package .metadata .cargo-feature-combinations ]
202+ exclude_features = [" default" ]
203+ isolated_feature_sets = [
204+ [" gpu" ],
205+ [" ui" ],
206+ ]
207+ skip_optional_dependencies = true
208+
209+ [package .metadata .cargo-feature-combinations .target .'cfg(target_os = "linux")' ]
210+ replace = true
211+ # Start from a fresh default config on Linux: `isolated_feature_sets` and
212+ # `skip_optional_dependencies` are not inherited from the base config.
213+ exclude_features = [" default" , " cuda" ]
147214```
148215
149216<details >
0 commit comments