From: whitequark Date: Thu, 29 Sep 2016 11:22:40 +0000 (+0000) Subject: doc: build-script: use cfg(unix), not a hardcoded x86_64 triple X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~13^2~64^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5b42a33d251de1f5f9cfc7d43b53505be180be4f;p=cargo.git doc: build-script: use cfg(unix), not a hardcoded x86_64 triple This used to not be possible, but it is now, so let's promote best practices. --- diff --git a/src/doc/build-script.md b/src/doc/build-script.md index cc50b4c74..f5fe8e283 100644 --- a/src/doc/build-script.md +++ b/src/doc/build-script.md @@ -440,7 +440,7 @@ build = "build.rs" [dependencies] libssh2-sys = { git = "https://github.com/alexcrichton/ssh2-rs" } -[target.x86_64-unknown-linux-gnu.dependencies] +[target.'cfg(unix)'.dependencies] openssl-sys = { git = "https://github.com/alexcrichton/openssl-sys" } # ... @@ -452,7 +452,7 @@ crate (`libgit2-sys`) links to the `git2` native library. Here we also see the unconditional dependency on `libssh2` via the `libssh2-sys` crate, as well as a platform-specific dependency on `openssl-sys` -for unix (other variants elided for now). It may seem a little counterintuitive +for \*nix (other variants elided for now). It may seem a little counterintuitive to express *C dependencies* in the *Cargo manifest*, but this is actually using one of Cargo’s conventions in this space.