Skip to content

Commit

Permalink
Add xdoc command. (#39)
Browse files Browse the repository at this point in the history
Setting RUSTDOCFLAGS in addition to RUSTFLAGS causes rustdoc to use the
desired sysroot.

Closes #38.
  • Loading branch information
Aehmlo authored and phil-opp committed Jul 9, 2019
1 parent 30e3d24 commit f7904f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/bin/cargo-xdoc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extern crate xargo_lib;

pub fn main() {
xargo_lib::main_common("doc");
}
4 changes: 3 additions & 1 deletion src/xargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ pub fn run(
let flags = rustflags.for_xargo(home)?;
if verbose {
writeln!(io::stderr(), "+ RUSTFLAGS={:?}", flags).ok();
writeln!(io::stderr(), "+ RUSTDOCFLAGS={:?}", flags).ok();
}
cmd.env("RUSTFLAGS", flags);
cmd.env("RUSTFLAGS", &flags);
cmd.env("RUSTDOCFLAGS", &flags);

let locks = (home.lock_ro(&meta.host), home.lock_ro(cmode.triple()));

Expand Down

0 comments on commit f7904f4

Please sign in to comment.