Skip to content

Commit

Permalink
Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
z0w0 committed Nov 13, 2013
1 parent 11b0784 commit 5748699
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/librustpkg/api.rs
Expand Up @@ -81,6 +81,11 @@ pub fn new_workcache_context(p: &Path) -> workcache::Context {

pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,
lib: Path) {
build_lib_with_cfgs(sysroot, root, name, version, lib, ~[])
}

pub fn build_lib_with_cfgs(sysroot: Path, root: Path, name: ~str,
version: Version, lib: Path, cfgs: ~[~str]) {
let cx = default_context(sysroot, root.clone());
let pkg_src = PkgSrc {
source_workspace: root.clone(),
Expand All @@ -94,11 +99,16 @@ pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,
tests: ~[],
benchs: ~[]
};
pkg_src.build(&cx, ~[], []);
pkg_src.build(&cx, cfgs, []);
}

pub fn build_exe(sysroot: Path, root: Path, name: ~str, version: Version,
main: Path) {
build_exe_with_cfgs(sysroot, root, name, version, main, ~[])
}

pub fn build_exe_with_cfgs(sysroot: Path, root: Path, name: ~str,
version: Version, main: Path, cfgs: ~[~str]) {
let cx = default_context(sysroot, root.clone());
let pkg_src = PkgSrc {
source_workspace: root.clone(),
Expand All @@ -113,7 +123,7 @@ pub fn build_exe(sysroot: Path, root: Path, name: ~str, version: Version,
benchs: ~[]
};

pkg_src.build(&cx, ~[], []);
pkg_src.build(&cx, cfgs, []);
}

pub fn install_pkg(cx: &BuildContext,
Expand Down

5 comments on commit 5748699

@bors
Copy link
Contributor

@bors bors commented on 5748699 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 5748699 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging z0w0/rust/issue-9944 = 5748699 into auto

@bors
Copy link
Contributor

@bors bors commented on 5748699 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

z0w0/rust/issue-9944 = 5748699 merged ok, testing candidate = 0a577f3

@bors
Copy link
Contributor

@bors bors commented on 5748699 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 5748699 Nov 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 0a577f3

Please sign in to comment.