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

北慕城南 提交于 2019-12-10 22:03:30

问题


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


回答1:


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.




回答2:


It is now possible using .cargo/config.

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



来源:https://stackoverflow.com/questions/25978808/how-to-pass-l-linker-flag-to-rustc-for-cargo-based-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!