mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-28 08:43:26 +00:00
Rename make_variant to foreign_cc_rule_variant (#993)
Co-authored-by: jheaff1 <jheaff1@outlook.com>
This commit is contained in:
parent
41c937a7a9
commit
2094b4ab82
|
@ -144,7 +144,7 @@ load(
|
|||
"create_attrs",
|
||||
"expand_locations_and_make_variables",
|
||||
)
|
||||
load("//foreign_cc/private:transitions.bzl", "make_variant")
|
||||
load("//foreign_cc/private:transitions.bzl", "foreign_cc_rule_variant")
|
||||
load(
|
||||
"//foreign_cc/private/framework:platform.bzl",
|
||||
"os_name",
|
||||
|
@ -426,7 +426,7 @@ def cmake_variant(name, toolchain, **kwargs):
|
|||
toolchain: The desired make variant toolchain to use, e.g. @rules_foreign_cc//toolchains:preinstalled_nmake_toolchain
|
||||
**kwargs: Remaining keyword arguments
|
||||
"""
|
||||
make_variant(
|
||||
foreign_cc_rule_variant(
|
||||
name = name,
|
||||
rule = cmake,
|
||||
toolchain = toolchain,
|
||||
|
|
|
@ -18,7 +18,7 @@ load(
|
|||
"create_attrs",
|
||||
"expand_locations_and_make_variables",
|
||||
)
|
||||
load("//foreign_cc/private:transitions.bzl", "make_variant")
|
||||
load("//foreign_cc/private:transitions.bzl", "foreign_cc_rule_variant")
|
||||
load("//foreign_cc/private/framework:platform.bzl", "os_name")
|
||||
load("//toolchains/native_tools:tool_access.bzl", "get_make_data", "get_pkgconfig_data")
|
||||
|
||||
|
@ -253,7 +253,7 @@ def configure_make_variant(name, toolchain, **kwargs):
|
|||
toolchain: The desired make variant toolchain to use, e.g. @rules_foreign_cc//toolchains:preinstalled_nmake_toolchain
|
||||
**kwargs: Remaining keyword arguments
|
||||
"""
|
||||
make_variant(
|
||||
foreign_cc_rule_variant(
|
||||
name = name,
|
||||
rule = configure_make,
|
||||
toolchain = toolchain,
|
||||
|
|
|
@ -18,7 +18,7 @@ load(
|
|||
"expand_locations_and_make_variables",
|
||||
)
|
||||
load("//foreign_cc/private:make_script.bzl", "create_make_script")
|
||||
load("//foreign_cc/private:transitions.bzl", _make_variant = "make_variant")
|
||||
load("//foreign_cc/private:transitions.bzl", "foreign_cc_rule_variant")
|
||||
load("//toolchains/native_tools:tool_access.bzl", "get_make_data")
|
||||
|
||||
def _make(ctx):
|
||||
|
@ -131,7 +131,7 @@ def make_variant(name, toolchain, **kwargs):
|
|||
toolchain: The desired make variant toolchain to use, e.g. @rules_foreign_cc//toolchains:preinstalled_nmake_toolchain
|
||||
**kwargs: Remaining keyword arguments
|
||||
"""
|
||||
_make_variant(
|
||||
foreign_cc_rule_variant(
|
||||
name = name,
|
||||
rule = make,
|
||||
toolchain = toolchain,
|
||||
|
|
|
@ -41,8 +41,8 @@ extra_toolchains_transitioned_foreign_cc_target = rule(
|
|||
incompatible_use_toolchain_transition = True,
|
||||
)
|
||||
|
||||
def make_variant(name, rule, toolchain, **kwargs):
|
||||
""" Wrapper macro around foreign cc rules to force usage of the given make variant toolchain.
|
||||
def foreign_cc_rule_variant(name, rule, toolchain, **kwargs):
|
||||
""" Wrapper macro around foreign cc rules to force usage of the given toolchain.
|
||||
|
||||
Args:
|
||||
name: The target name
|
||||
|
@ -51,12 +51,12 @@ def make_variant(name, rule, toolchain, **kwargs):
|
|||
**kwargs: Remaining keyword arguments
|
||||
"""
|
||||
|
||||
make_variant_target_name = name + "_"
|
||||
foreign_cc_rule_target_name = name + "_"
|
||||
|
||||
tags = kwargs.pop("tags", [])
|
||||
|
||||
rule(
|
||||
name = make_variant_target_name,
|
||||
name = foreign_cc_rule_target_name,
|
||||
tags = tags + ["manual"],
|
||||
**kwargs
|
||||
)
|
||||
|
@ -64,6 +64,6 @@ def make_variant(name, rule, toolchain, **kwargs):
|
|||
extra_toolchains_transitioned_foreign_cc_target(
|
||||
name = name,
|
||||
extra_toolchains = [toolchain],
|
||||
target = make_variant_target_name,
|
||||
target = foreign_cc_rule_target_name,
|
||||
tags = tags,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue