rules_foreign_cc/examples/toolchains_examples
UebelAndre 83e6cf48cf
Moved `workspace_definitions.bzl` to `foreign_cc/repositories.bzl` to solve for bzl-visibility issues. (#557)
2021-03-12 09:08:13 -08:00
..
.bazelrc Moved some additional examples into the examples directory (#509) 2021-02-16 08:13:25 -08:00
BUILD.bazel Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00
README.md Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00
WORKSPACE.bazel Moved `workspace_definitions.bzl` to `foreign_cc/repositories.bzl` to solve for bzl-visibility issues. (#557) 2021-03-12 09:08:13 -08:00
additional_toolchains.bzl Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00
fancy_platform_commands.bzl Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00
test_platform_name_rule.bzl Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00

README.md

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//foreign_cc/private/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 "registermappings" macro from "@rules_foreign_cc//foreign_cc/private/shell_toolchain/toolchains:defs.bzl", passing the mappings and toolchain_type = "@rules_foreign_cc//foreign_cc/private/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.