title: How to compile rust with specific specific C++ compiler
body: <p>I have a build in an isolated environment that does not have a C++ compiler in PATH.  How can I dynamically specify the C++ compiler for cargo to use (for ex: by environment variable)?</p>
  <p>It seems as though this is possible, but none of the solutions I've seen appear to match <a href="https://doc.rust-lang.org/cargo/reference/environment-variables.html" rel="nofollow noreferrer">the environment variable docs</a> or in the Cargo.toml <a href="https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies" rel="nofollow noreferrer"><code>[target]</code> docs</a>.</p>