Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass -L linker flag to rustc for cargo based project?

How do I make cargo pass -L linker flag to rustc invocations?

like image 330
Jaŭhien Piatlicki Avatar asked Sep 22 '14 16:09

Jaŭhien Piatlicki


2 Answers

It is now possible using .cargo/config.

See https://github.com/rust-lang/cargo/issues/1109 and http://doc.crates.io/config.html.

like image 181
mpe Avatar answered Sep 30 '22 18:09

mpe


Not yet. However, you can use a custom makefile for given Cargo project instead.

For example, Servo uses the Skia library by having a Rust wrapper in the same cargo project, and a build key that calls a custom makefile.

You can do something similar in this case, for now.

like image 30
Manishearth Avatar answered Sep 30 '22 17:09

Manishearth