Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5748699

Browse files
committedNov 13, 2013
Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API. Closes #9944.
1 parent 11b0784 commit 5748699

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎src/librustpkg/api.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ pub fn new_workcache_context(p: &Path) -> workcache::Context {
8181

8282
pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,
8383
lib: Path) {
84+
build_lib_with_cfgs(sysroot, root, name, version, lib, ~[])
85+
}
86+
87+
pub fn build_lib_with_cfgs(sysroot: Path, root: Path, name: ~str,
88+
version: Version, lib: Path, cfgs: ~[~str]) {
8489
let cx = default_context(sysroot, root.clone());
8590
let pkg_src = PkgSrc {
8691
source_workspace: root.clone(),
@@ -94,11 +99,16 @@ pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,
9499
tests: ~[],
95100
benchs: ~[]
96101
};
97-
pkg_src.build(&cx, ~[], []);
102+
pkg_src.build(&cx, cfgs, []);
98103
}
99104

100105
pub fn build_exe(sysroot: Path, root: Path, name: ~str, version: Version,
101106
main: Path) {
107+
build_exe_with_cfgs(sysroot, root, name, version, main, ~[])
108+
}
109+
110+
pub fn build_exe_with_cfgs(sysroot: Path, root: Path, name: ~str,
111+
version: Version, main: Path, cfgs: ~[~str]) {
102112
let cx = default_context(sysroot, root.clone());
103113
let pkg_src = PkgSrc {
104114
source_workspace: root.clone(),
@@ -113,7 +123,7 @@ pub fn build_exe(sysroot: Path, root: Path, name: ~str, version: Version,
113123
benchs: ~[]
114124
};
115125

116-
pkg_src.build(&cx, ~[], []);
126+
pkg_src.build(&cx, cfgs, []);
117127
}
118128

119129
pub fn install_pkg(cx: &BuildContext,

5 commit comments

Comments
 (5)

bors commented on Nov 17, 2013

@bors
Collaborator

bors commented on Nov 17, 2013

@bors
Collaborator

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

bors commented on Nov 17, 2013

@bors
Collaborator

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

bors commented on Nov 17, 2013

@bors
Collaborator

fast-forwarding master to auto = 0a577f3

Please sign in to comment.