【问题标题】:How do you conditionally compile based on a target triple?你如何根据目标三元组有条件地编译?
【发布时间】:2018-10-14 19:23:47
【问题描述】:

是否可以有条件地为特定的目标三元组进行编译?我在排除 x86_64-rumprun-netbsd 目标时遇到问题,而没有简单地用 #[cfg] 排除 netbsd

【问题讨论】:

标签: compilation rust netbsd


【解决方案1】:

您想使用target_vendor 配置,该配置具有rumprun 的值,如this PR 中所述。一般来说,您可以使用this page 中的任何目标供应商,如this PR 中所述。

【讨论】:

    猜你喜欢
    • 2017-08-04
    • 2021-12-05
    • 2015-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-07
    • 1970-01-01
    相关资源
    最近更新 更多