Skip to content

Commit 43ce1e7

Browse files
committed
Test that link argument order is maintained
Patch provided by @ehuss
1 parent 10cf701 commit 43ce1e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/testsuite/build_script.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,18 +1789,21 @@ fn output_separate_lines_new() {
17891789
fn main() {
17901790
println!("cargo:rustc-link-search=foo");
17911791
println!("cargo:rustc-link-lib=static=foo");
1792+
println!("cargo:rustc-link-lib=bar");
1793+
println!("cargo:rustc-link-search=bar");
17921794
}
17931795
"#,
17941796
)
17951797
.build();
1798+
// The order of the arguments passed to rustc is important.
17961799
p.cargo("build -v")
17971800
.with_status(101)
17981801
.with_stderr_contains(
17991802
"\
18001803
[COMPILING] foo v0.5.0 ([CWD])
18011804
[RUNNING] `rustc [..] build.rs [..]`
18021805
[RUNNING] `[..]/foo-[..]/build-script-build`
1803-
[RUNNING] `rustc --crate-name foo [..] -L foo -l static=foo`
1806+
[RUNNING] `rustc --crate-name foo [..] -L foo -L bar -l static=foo -l bar`
18041807
[ERROR] could not find native static library [..]
18051808
",
18061809
)

0 commit comments

Comments
 (0)