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>
33 lines
1,004 B
Python
33 lines
1,004 B
Python
load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:defs.bzl", "register_mappings")
|
|
load(":additional_toolchains.bzl", "ADD_TOOLCHAIN_MAPPINGS")
|
|
load(":test_platform_name_rule.bzl", "test_platform_name")
|
|
|
|
# Targets of type "toolchain" are created inside for the values of ADD_TOOLCHAIN_MAPPINGS,
|
|
# with the correct constraints taken from mappings.
|
|
# The "toolchain_data" is referencing generated @commands_overloads.
|
|
register_mappings(
|
|
mappings = ADD_TOOLCHAIN_MAPPINGS,
|
|
toolchain_type_ = "@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:shell_commands",
|
|
)
|
|
|
|
constraint_setting(name = "fancy_constraint")
|
|
|
|
constraint_value(
|
|
name = "fancy_constraint_value",
|
|
constraint_setting = ":fancy_constraint",
|
|
)
|
|
|
|
platform(
|
|
name = "fancy_platform",
|
|
constraint_values = [
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:x86_64",
|
|
":fancy_constraint_value",
|
|
],
|
|
)
|
|
|
|
test_platform_name(
|
|
name = "test_platform_name",
|
|
expected = "Fancy",
|
|
)
|