Skip to content

Commit a2761ac

Browse files
committed
rustpkg: Change this example to show how to do a custom build
1 parent 35f3b63 commit a2761ac

File tree

1 file changed

+6
-0
lines changed
  • src/librustpkg/testsuite/pass/fancy-lib

1 file changed

+6
-0
lines changed

src/librustpkg/testsuite/pass/fancy-lib/pkg.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use core::run;
12+
1113
pub fn main() {
1214
let cwd = os::getcwd();
1315
debug!("cwd = %s", cwd.to_str());
1416
let file = io::file_writer(&Path(~"fancy-lib/build/generated.rs"),
1517
[io::Create]).get();
1618
file.write_str("pub fn wheeeee() { for [1, 2, 3].each() |_| { assert!(true); } }");
19+
20+
// now compile the crate itself
21+
run::run_program("rustc", ~[~"fancy-lib/fancy-lib.rs", ~"--lib",
22+
~"-o", ~"fancy-lib/build/fancy_lib"]);
1723
}

0 commit comments

Comments
 (0)