2024-07-23 10:32:00 -05:00
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
2024-07-23 13:50:00 -05:00
|
|
|
use run_make_support::{cwd, run, rustc};
|
2024-07-23 10:32:00 -05:00
|
|
|
|
|
|
|
// Attempt to build this dependency tree:
|
|
|
|
//
|
2024-07-23 13:50:00 -05:00
|
|
|
// A.1 A.2
|
|
|
|
// |\ |
|
|
|
|
// | \ |
|
|
|
|
// B \ C
|
|
|
|
// \ | /
|
|
|
|
// \|/
|
|
|
|
// D
|
2024-07-23 10:32:00 -05:00
|
|
|
//
|
|
|
|
// Note that A.1 and A.2 are crates with the same name.
|
|
|
|
|
2024-07-23 17:38:42 -05:00
|
|
|
// original Makefile at https://github.com/rust-lang/rust/issues/14469
|
2024-07-23 13:50:00 -05:00
|
|
|
|
2024-07-23 10:32:00 -05:00
|
|
|
fn main() {
|
2024-07-23 13:50:00 -05:00
|
|
|
rustc().metadata("1").extra_filename("-1").input("a.rs").run();
|
|
|
|
rustc().metadata("2").extra_filename("-2").input("a.rs").run();
|
|
|
|
rustc().input("b.rs").extern_("a", "liba-1.rlib").run();
|
|
|
|
rustc().input("c.rs").extern_("a", "liba-2.rlib").run();
|
|
|
|
println!("before");
|
|
|
|
rustc().cfg("before").input("d.rs").extern_("a", "liba-1.rlib").run();
|
|
|
|
run("d");
|
|
|
|
println!("after");
|
|
|
|
rustc().cfg("after").input("d.rs").extern_("a", "liba-1.rlib").run();
|
|
|
|
run("d");
|
2024-07-23 10:32:00 -05:00
|
|
|
}
|