rustdoc: pass through --cfg to rustc

Closes #10623
This commit is contained in:
Corey Richardson
2013-11-24 23:31:21 -05:00
parent b3ff24adaa
commit 6fbe2a0c8b
3 changed files with 12 additions and 6 deletions

View File

@@ -96,6 +96,7 @@ pub fn opts() -> ~[groups::OptGroup] {
optopt("o", "output", "where to place the output", "PATH"),
optmulti("L", "library-path", "directory to add to crate search path",
"DIR"),
optmulti("", "cfg", "pass a --cfg to rustc", ""),
optmulti("", "plugin-path", "directory to load plugins from", "DIR"),
optmulti("", "passes", "space separated list of passes to also run, a \
value of `list` will print available passes",
@@ -194,11 +195,12 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
// First, parse the crate and extract all relevant information.
let libs = Cell::new(matches.opt_strs("L").map(|s| Path::new(s.as_slice())));
let cfgs = Cell::new(matches.opt_strs("cfg"));
let cr = Cell::new(Path::new(cratefile));
info!("starting to run rustc");
let (crate, analysis) = do std::task::try {
let cr = cr.take();
core::run_core(libs.take().move_iter().collect(), &cr)
core::run_core(libs.take().move_iter().collect(), cfgs.take(), &cr)
}.unwrap();
info!("finished with rustc");
local_data::set(analysiskey, analysis);