diff options
| author | Zack Corr <zack@z0w0.me> | 2013-11-13 14:54:17 +1000 |
|---|---|---|
| committer | Zack Corr <zack@z0w0.me> | 2013-11-13 14:54:17 +1000 |
| commit | 57486994d56e57044a37144fa6f741a946ff295a (patch) | |
| tree | d2557701de7054de26d2f9015c9caa1f2f9d14d6 | |
| parent | 11b07847e6e75bfd26efe85f8c60f53fcc55a631 (diff) | |
Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API. Closes #9944.
| -rw-r--r-- | src/librustpkg/api.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/librustpkg/api.rs b/src/librustpkg/api.rs index bb73882bde8..0d0d0b7c4c7 100644 --- a/src/librustpkg/api.rs +++ b/src/librustpkg/api.rs @@ -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(), @@ -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(), @@ -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, |
