remove .2.19 from toolchain params
Only the default toolchain can be exposed.
This commit is contained in:
@@ -1,36 +1,10 @@
|
||||
load("@zig-cc-bazel//toolchain:defs.bzl", "zig_build_macro")
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
zig_build_macro(absolute_path={absolute_path}, zig_include_root={zig_include_root})
|
||||
|
||||
constraint_setting(name = "libc")
|
||||
|
||||
constraint_value(
|
||||
name = "musl",
|
||||
constraint_setting = ":libc",
|
||||
package(
|
||||
default_visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
|
||||
platform(
|
||||
name = "platform_x86_64-macos-gnu",
|
||||
constraint_values = [
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "platform_x86_64-linux-gnu",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "platform_x86_64-linux-musl",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:x86_64",
|
||||
":musl",
|
||||
],
|
||||
zig_build_macro(
|
||||
absolute_path={absolute_path},
|
||||
zig_include_root={zig_include_root},
|
||||
)
|
||||
|
||||
@@ -39,7 +39,8 @@ TARGET_CONFIGS = [
|
||||
tool_paths={"ld": "ld64.lld"},
|
||||
),
|
||||
struct(
|
||||
target="x86_64-linux-gnu.2.19",
|
||||
target="x86_64-linux-gnu",
|
||||
target_suffix = ".2.19",
|
||||
includes=[
|
||||
"libunwind/include",
|
||||
"libc/include/generic-glibc",
|
||||
@@ -182,11 +183,21 @@ def zig_build_macro(absolute_path, zig_include_root):
|
||||
filegroup(name="zig_compiler", srcs=["zig"])
|
||||
filegroup(name="lib/std", srcs=native.glob(["lib/std/**"]))
|
||||
|
||||
native.constraint_setting(name = "libc")
|
||||
|
||||
native.constraint_value(
|
||||
name = "musl",
|
||||
constraint_setting = ":libc",
|
||||
)
|
||||
|
||||
lazy_filegroups = {}
|
||||
|
||||
for target_config in TARGET_CONFIGS:
|
||||
target = target_config.target
|
||||
native.platform(name = target, constraint_values = target_config.constraint_values)
|
||||
native.platform(
|
||||
name = target,
|
||||
constraint_values = target_config.constraint_values,
|
||||
)
|
||||
|
||||
all_srcs = []
|
||||
ar_srcs = [":zig_compiler"]
|
||||
@@ -219,6 +230,7 @@ def zig_build_macro(absolute_path, zig_include_root):
|
||||
zig_cc_toolchain_config(
|
||||
name = target + "_cc_toolchain_config",
|
||||
target = target,
|
||||
target_suffix = getattr(target_config, 'target_suffix', ''),
|
||||
tool_paths = absolute_tool_paths,
|
||||
cxx_builtin_include_directories = cxx_builtin_include_directories,
|
||||
copts = target_config.copts,
|
||||
|
||||
@@ -40,7 +40,7 @@ def _zig_cc_toolchain_config_impl(ctx):
|
||||
"-I" + d
|
||||
for d in ctx.attr.cxx_builtin_include_directories
|
||||
] + [
|
||||
"-target", ctx.attr.target,
|
||||
"-target", ctx.attr.target + ctx.attr.target_suffix,
|
||||
"-no-canonical-prefixes",
|
||||
"-Wno-builtin-macro-redefined",
|
||||
"-D__DATE__=\"redacted\"",
|
||||
@@ -104,6 +104,7 @@ zig_cc_toolchain_config = rule(
|
||||
"target_system_name": attr.string(),
|
||||
"target_cpu": attr.string(),
|
||||
"target_libc": attr.string(),
|
||||
"target_suffix": attr.string(),
|
||||
"compiler": attr.string(),
|
||||
"abi_version": attr.string(),
|
||||
"abi_libc_version": attr.string(),
|
||||
|
||||
Reference in New Issue
Block a user