mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-25 17:31:25 +00:00
ec690c5075
The former has been deprecated and will break by --incompatible_use_platforms_repo_for_constraints, as announced in https://github.com/bazelbuild/bazel/issues/8622. Fixes #354. Co-authored-by: UebelAndre <andre.brisco@gmail.com> |
||
---|---|---|
.. | ||
.bazelrc | ||
additional_toolchains.bzl | ||
BUILD | ||
fancy_platform_commands.bzl | ||
README.md | ||
test_platform_name_rule.bzl | ||
WORKSPACE |
###How to add a shell toolchain implementation for a custom platform: (to modify the fragments of generated shell script)
- define your own shell toolchain file(s) by copying @rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains/impl:linux_commands.bzl, and modifying the methods.
- create a mapping: a list of ToolchainMapping with the mappings between created file(s) and execution or/and target platform constraints.
- in the BUILD file of some package, call "register_mappings" macro from "@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:defs.bzl", passing the mappings and toolchain_type_ = "@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:shell_commands"
- in the WORKSPACE file of your main repository, when you initialize rules_foreign_cc, pass the mappings and the package, in which BUILD file you called "register_mappings" macro
Please look how it is done in this example.