Skip to content

Commit c926113

Browse files
committed
Force --extern <name>=<path>.rmeta to .rlib. Cargo sometimes tries to overoptimize compile time.
1 parent a166f21 commit c926113

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/extern_args.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,16 @@ impl ExternArgs {
9898

9999
while let Some(arg) = arg_iter.next() {
100100
match arg {
101-
"-L" | "--library-path" | "--extern" => {
101+
"-L" | "--library-path" => {
102102
self.suffix_args.push(arg.to_owned());
103103
self.suffix_args
104104
.push(arg_iter.next().unwrap_or("").to_owned());
105105
}
106+
"--extern" => { // needs a hack to force reference to rlib over rmeta
107+
self.suffix_args.push(arg.to_owned());
108+
self.suffix_args
109+
.push(arg_iter.next().unwrap_or("").replace(".rmeta", ".rlib").to_owned());
110+
}
106111
_ => {}
107112
}
108113
}

0 commit comments

Comments
 (0)