运行 bazel 构建命令时使用 wrenv.exe 配置构建环境的最简洁方法是什么。
bazel build --platforms=@my_bazel//platforms::vxworks_69_arm7 //crypto:crypto
我想覆盖tool_path,但没有成功。
tool_path(
name = "gcc",
path = "c:/path/to/wrenv.exe -p vxworks-6.9 ccarm",
)
按如下方式设置 genrule 似乎很麻烦?
genrule(
name = "setup_and_build_crypto_7.0",
srcs = [],
outs = ["build_output_env1.txt"],
cmd = """
C:/path/to/wrenv.exe -p vxworks-7.0 && \
bazel build //crypto:crypto > $@
""",
)
genrule(
name = "setup_and_build_crypto_6.9",
srcs = [],
outs = ["build_output_env2.txt"],
cmd = """
C:/path/to/wrenv.exe -p vxworks-6.9 && \
bazel build //crypto:crypto > $@
""",
)
有什么想法吗?