首页 > 解决方案 > Bazel 通过一次调用构建多个目标架构?

问题描述

是否可以将 bazel 目标与特定的工具链/平台相关联?

bazel build ...想让 bazel 为许多不同的目标架构构建相同的 cc_library。并且还跳过特定目标架构的一些目标。

显然,如果我使用不同的标志多次运行 bazel 并标记要忽略的测试,我可以实现这一点。但这不是很方便。

标签: bazel

解决方案


Unless something had recently changed, I am afraid you are (at least at the moment) out of luck on this one. My understanding of the documentation (and recollection of when I was poking around this area) is that bazel will in the end match one (or no) toolchain for a given toolchain type (and in case of multiple possible matches pick the first one in the list). Hence you won't be able to define one rule for one target matching multiple toolchains for a given single build.


推荐阅读