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

doc: Update reference with better description of target_env #33437

Merged
merged 1 commit into from
May 7, 2016
Merged
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
44 changes: 26 additions & 18 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2063,33 +2063,41 @@ arbitrarily complex configurations through nesting.

The following configurations must be defined by the implementation:

* `debug_assertions` - Enabled by default when compiling without optimizations.
This can be used to enable extra debugging code in development but not in
production. For example, it controls the behavior of the standard library's
`debug_assert!` macro.
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`, `"x86_64"`
`"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or `"aarch64"`.
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
`"big"`.
* `target_env = ".."` - An option provided by the compiler by default
describing the runtime environment of the target platform. Some examples of
this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
option may also be blank on some platforms.
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`,
`"x86_64"` `"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or
`"aarch64"`. This value is closely related to the first element of
the platform target triple, though it is not identical.
* `target_os = "..."` - Operating system of the target, examples
include `"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`,
`"freebsd"`, `"dragonfly"`, `"bitrig"` , `"openbsd"` or
`"netbsd"`. This value is closely related to the second and third
element of the platform target triple, though it is not identical.
* `target_family = "..."` - Operating system family of the target, e. g.
`"unix"` or `"windows"`. The value of this configuration option is defined
as a configuration itself, like `unix` or `windows`.
* `target_os = "..."` - Operating system of the target, examples include
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
`"bitrig"` , `"openbsd"` or `"netbsd"`.
* `unix` - See `target_family`.
* `windows` - See `target_family`.
* `target_env = ".."` - Further disambiguates the target platform with
information about the ABI/libc. Presently this value is either
`"gnu"`, `"msvc"`, `"musl"`, or the empty string. For historical
reasons this value has only been defined as non-empty when needed
for disambiguation. Thus on many GNU platforms this value will be
empty. This value is closely related to the fourth element of the
platform target triple, though it is not identical. For example,
embedded ABIs such as `gnueabihf` will simply define `target_env` as
`"gnu"`.
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
`"big"`.
* `target_pointer_width = "..."` - Target pointer width in bits. This is set
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
64-bit pointers.
* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
simply `"unknown"`.
* `test` - Enabled when compiling the test harness (using the `--test` flag).
* `unix` - See `target_family`.
* `windows` - See `target_family`.
* `debug_assertions` - Enabled by default when compiling without optimizations.
This can be used to enable extra debugging code in development but not in
production. For example, it controls the behavior of the standard library's
`debug_assert!` macro.

You can also set another attribute based on a `cfg` variable with `cfg_attr`:

Expand Down