Is it possible to specify `panic = “abort”` for a specific target?

若如初见. 提交于 2019-12-12 13:34:34

问题


If I specify panic like this, it works for all targets:

[profile.release]
panic = "abort"

I want to specify panic = "abort" only for target=arm-linux-androideabi.


回答1:


You will need to add a .cargo/config to your project and use it to specify the panic settings instead of Cargo.toml:

[target.arm-linux-androideabi]
rustflags = ["-C", "panic=abort"]

The two main configuration headings you will want to look at are [target.$triple] and [target.'cfg(...)'].



来源:https://stackoverflow.com/questions/47663961/is-it-possible-to-specify-panic-abort-for-a-specific-target

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