From: Ran Benita Date: Wed, 19 Jul 2017 22:30:32 +0000 (+0300) Subject: Document the CARGO_CFG_* environment variables - fixes #4302 X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~7^2~47^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4c20cbcfc1dd7c0fb22d2b75cb459242f8b2cf18;p=cargo.git Document the CARGO_CFG_* environment variables - fixes #4302 --- diff --git a/src/doc/environment-variables.md b/src/doc/environment-variables.md index 276bb903c..21274f9f3 100644 --- a/src/doc/environment-variables.md +++ b/src/doc/environment-variables.md @@ -80,6 +80,15 @@ let out_dir = env::var("OUT_DIR").unwrap(); built, this environment variable will be present where `` is the name of the feature uppercased and having `-` translated to `_`. +* `CARGO_CFG_` - For each [configuration option][configuration] of the + package being built, this environment variable will + contain the value of the configuration, where `` is + the name of the configuration uppercased and having `-` + translated to `_`. + Boolean configurations are present if they are set, and + not present otherwise. + Configurations with multiple values are joined to a + single variable with the values delimited by `,`. * `OUT_DIR` - the folder in which all output should be placed. This folder is inside the build directory for the package being built, and it is unique for the package in question. @@ -107,6 +116,7 @@ let out_dir = env::var("OUT_DIR").unwrap(); [links]: build-script.html#the-links-manifest-key [profile]: manifest.html#the-profile-sections +[configuration]: https://doc.rust-lang.org/reference/attributes.html#conditional-compilation [clang]:http://clang.llvm.org/docs/CrossCompilation.html#target-triple [jobserver]: http://make.mad-scientist.net/papers/jobserver-implementation/