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/toolchains.bzl
jheaff1 2e61d9588a
Add <rule>_variant macros (#734)
The macros utilise bazel "transitions" to set the `make` toolchain used
in the configure_make(), cmake() or make() rules to
a given make variant toolchain, e.g. preinstalled_nmake.

Note that the msvc constraint was removed from the
`exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as
the condition is not actually met even when building with msvc. See
https://github.com/bazelbuild/bazel/issues/7730.

This will be tested in PR#729
2021-07-28 15:30:04 +01:00

20 lines
790 B
Python

"""A module defining the various toolchain definitions for `rules_foreign_cc`"""
load(":built_toolchains.bzl", _built_toolchains = "built_toolchains")
load(":prebuilt_toolchains.bzl", _prebuilt_toolchains = "prebuilt_toolchains")
# Re-expose the built toolchains macro
built_toolchains = _built_toolchains
# Re-expose the prebuilt toolchains macro
prebuilt_toolchains = _prebuilt_toolchains
# buildifier: disable=unnamed-macro
def preinstalled_toolchains():
"""Register toolchains for various build tools expected to be installed on the exec host"""
native.register_toolchains(
str(Label("//toolchains:preinstalled_cmake_toolchain")),
str(Label("//toolchains:preinstalled_make_toolchain")),
str(Label("//toolchains:preinstalled_ninja_toolchain")),
)