Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API #10454

Merged
merged 1 commit into from
Nov 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/librustpkg/api.rs
Original file line number Diff line number Diff line change
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