是否可以为特定目标指定“panic =“abort""? [英] Is it possible to specify `panic = "abort"` for a specific target?

查看:88
本文介绍了是否可以为特定目标指定“panic =“abort""?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我像这样指定 panic,它适用于所有目标:

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

[profile.release]
panic = "abort"

我只想为 target=arm-linux-androideabi 指定 panic = "abort".

推荐答案

你需要添加一个 .cargo/config 到您的项目并使用它来指定恐慌设置而不是 Cargo.toml:

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"]

您需要查看的两个主要配置标题是 [target.$triple][target.'cfg(...)'].

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

这篇关于是否可以为特定目标指定“panic =“abort""?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆