[native supports-expr] docs changes (#16971)

This commit is contained in:
nicole mazzuca 2021-05-21 13:14:02 -07:00 committed by GitHub
parent 49b67d9cb8
commit a3db16a447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -138,6 +138,7 @@ The grammar for the supports expression uses standard operators:
- `(expr)` - grouping/precedence
The predefined expressions are computed from standard triplet settings:
- `native` - `TARGET_TRIPLET` == `HOST_TRIPLET`
- `x64` - `VCPKG_TARGET_ARCHITECTURE` == `"x64"`
- `x86` - `VCPKG_TARGET_ARCHITECTURE` == `"x86"`
- `arm` - `VCPKG_TARGET_ARCHITECTURE` == `"arm"` or `VCPKG_TARGET_ARCHITECTURE` == `"arm64"`

View File

@ -370,7 +370,7 @@ platform-expression =
| platform-expression-and
| platform-expression-or ;
platform-expression-identifier =
platform-expression-identifier =
| identifier-character, { identifier-character }, optional-whitespace ;
platform-expression-simple =
@ -396,6 +396,8 @@ Ands and ors are a list of `&` or `|` separated identifiers, negated expressions
One may not mix `&` and `|` without parentheses for grouping.
These predefined identifier expressions are computed from standard triplet settings:
- `native` - `TARGET_TRIPLET` == `HOST_TRIPLET`;
useful for ports which depend on their own built binaries in their build.
- `x64` - `VCPKG_TARGET_ARCHITECTURE` == `"x64"`
- `x86` - `VCPKG_TARGET_ARCHITECTURE` == `"x86"`
- `arm` - `VCPKG_TARGET_ARCHITECTURE` == `"arm"` or `VCPKG_TARGET_ARCHITECTURE` == `"arm64"`

View File

@ -57,3 +57,9 @@ else()
# This is a cross build
endif()
```
## Host-only ports
Some ports are host-only: script ports and tool ports are common examples.
In this case, you can use the `"native"` supports expression to describe this.
This supports expression is true when `TARGET_TRIPLET == HOST_TRIPLET`.