-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentation
Description
Cargo exposes some CARGO_CFG_*
environment variables to build scripts. Here are the ones from my machine:
CARGO_CFG_TARGET_FEATURE=sse,sse2
CARGO_CFG_TARGET_ENV=gnu
CARGO_CFG_TARGET_VENDOR=unknown
CARGO_CFG_TARGET_HAS_ATOMIC=16,32,64,8,ptr
CARGO_CFG_TARGET_THREAD_LOCAL=
CARGO_CFG_TARGET_ENDIAN=little
CARGO_CFG_TARGET_ARCH=x86_64
CARGO_CFG_UNIX=
CARGO_CFG_TARGET_POINTER_WIDTH=64
CARGO_CFG_DEBUG_ASSERTIONS=
CARGO_CFG_TARGET_OS=linux
CARGO_CFG_TARGET_FAMILY=unix
In my case, I want to use them instead of manually parsing $TARGET
. It'd be better since I could use the same type of cfg conditions in the build script as in the code.
But these variables are not documented in http://doc.crates.io/environment-variables.html. Should they be? Or are they meant for internal use only and should not be relied upon?
Thanks.
(This was briefly mentioned in rust-lang/rfcs#2048 (comment)).
math4tots
Metadata
Metadata
Assignees
Labels
A-documenting-cargo-itselfArea: Cargo's documentationArea: Cargo's documentation