load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_zig//zig:defs.bzl", "zig_library") cc_library( name = "retain_runfiles_init", srcs = ["runfiles_init.c"], # Retain the constructor even when its object is in a static archive. # Mach-O adds an underscore to the exported C symbol. linkopts = select({ "@platforms//os:macos": ["-Wl,-u,__bazel_runfiles_init"], "//conditions:default": ["-Wl,-u,_bazel_runfiles_init"], }), ) zig_library( name = "bazel", main = "bazel.zig", tags = ["manual"], visibility = ["//visibility:public"], deps = [ ":retain_runfiles_init", "//stdx", "@rules_zig//zig/runfiles", ], )