def METHOD_NAME(repository_ctx):
    """Generate BUILD file with 'toolchain' targets for the local host C++ toolchain.
    Args:
      repository_ctx: repository context
    """
    cpu_value = get_cpu_value(repository_ctx)
    if cpu_value.startswith("darwin"):
        paths = resolve_labels(repository_ctx, [
            "@bazel_tools//tools/cpp:BUILD.toolchains.tpl",
        ])
        repository_ctx.template(
            "BUILD",
            paths["@bazel_tools//tools/cpp:BUILD.toolchains.tpl"],
            {"%{name}": get_cpu_value(repository_ctx)},
        )
    else:
        repository_ctx.file("BUILD", "# C++ toolchain autoconfiguration was disabled by BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN env variable.")