Skip to content

Commit

Permalink
rustpkg: More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
z0w0 authored and graydon committed Feb 16, 2013
1 parent e34e072 commit c82183d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/librustpkg/util.rs
Expand Up @@ -16,7 +16,8 @@ use syntax::ast_util::*;
use syntax::{ast, attr, codemap, diagnostic, fold, parse, visit};
use codemap::span;
use semver::Version;
use std::{json, term, sort};
use std::{json, term, sort, getopts};
use getopts::groups::getopts;
use api::Listener;

pub struct Package {
Expand Down Expand Up @@ -866,14 +867,15 @@ pub fn compile_input(sysroot: Option<Path>, input: driver::input, dir: &Path,
let bin_dir = dir.push(~"bin");
let test_dir = dir.push(~"test");
let binary = os::args()[0];
let options: @session::options = @{
binary: binary,
crate_type: session::unknown_crate,
optimize: if opt { session::Aggressive } else { session::No },
test: test,
maybe_sysroot: sysroot,
.. *session::basic_options()
};
let matches = getopts(flags, driver::optgroups()).get();
let mut options = driver::build_session_options(binary, matches,
diagnostic::emit);

options.crate_type = session::unknown_crate;
options.optimize = if opt { session::Aggressive } else { session::No };
options.test = test;
options.maybe_sysroot = sysroot;

let sess = driver::build_session(options, diagnostic::emit);
let cfg = driver::build_configuration(sess, binary, input);
let mut outputs = driver::build_output_filenames(input, &None, &None,
Expand Down

0 comments on commit c82183d

Please sign in to comment.