2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-25 17:31:25 +00:00
rules_foreign_cc/toolchains_examples
Attila Oláh ec690c5075
Replace references to @bazel_tools//platforms with @platforms//. (#427)
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>
2021-01-23 12:28:38 -08:00
..
.bazelrc Register shell toolchain implementations in the correct order and allow customization (#214) 2019-01-31 15:11:28 +01:00
additional_toolchains.bzl Register shell toolchain implementations in the correct order and allow customization (#214) 2019-01-31 15:11:28 +01:00
BUILD Replace references to @bazel_tools//platforms with @platforms//. (#427) 2021-01-23 12:28:38 -08:00
fancy_platform_commands.bzl Fix Buildifier warnings (#395) 2020-05-04 19:50:45 +02:00
README.md Register shell toolchain implementations in the correct order and allow customization (#214) 2019-01-31 15:11:28 +01:00
test_platform_name_rule.bzl Register shell toolchain implementations in the correct order and allow customization (#214) 2019-01-31 15:11:28 +01:00
WORKSPACE Register shell toolchain implementations in the correct order and allow customization (#214) 2019-01-31 15:11:28 +01:00

###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.