Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for depend-defaults #119

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion vcpkg/reference/vcpkg-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This example demonstrates a manifest for an application using `boost-system`, `c
| Name | Required | Type | Description |
|------|----------|--------|-------------|
| [builtin-baseline](#builtin-baseline) | No | string | Version pins to use when building as top-level |
| [depend-defaults][] | No | bool | Default value for [default-features](#dependency-default-features) of dependencies |
| [default-features](#default-features) | No | bool | Require the [features](../users/manifests.md#features) listed as on-by-default |
| [dependencies](#dependencies) | No | [Dependency][][] | List of dependencies required to build and use this project |
| [description](#description) | Libraries | string or string[] | The project description |
Expand Down Expand Up @@ -66,6 +67,14 @@ This field indicates the commit of <https://github.com/microsoft/vcpkg> which pr

See [versioning](../users/versioning.md#baselines) and [Using registries](../users/registries.md) for more semantic details.

### <a name="depend-defaults"></a> `"depend-defaults"`

The default value for the [`"default-features"`](#dependency-default-features) field of dependencies. A boolean. `true` by default. Optional.

Disables [default features](#default-features) for the port's dependencies. If used in the top-level manifest, disables default features for the whole dependency tree.

[depend-defaults]: #depend-defaults

### <a name="default-features"></a> `"default-features"`

The set of features needed for reasonable behavior without additional customization.
Expand Down Expand Up @@ -293,7 +302,7 @@ Strings are interpreted as an object with _name_ defined to the string value.

### <a name="dependency-default-features"></a> [Dependency][]: `"default-features"`

A boolean indicating that the project depends on the 'on-by-default' features of the dependency. Defaults to `true`.
A boolean indicating that the project depends on the 'on-by-default' features of the dependency. Defaults to `true` if [depend-defaults][] is not set.

In most cases, this should be defined to `false` and any needed features should be explicitly depended upon.

Expand Down