[bazel] Use copy_file rule for zlib-ng (#152752)

This avoids cp usage for potential windows / PATH-less builds
This commit is contained in:
Keith Smiley 2025-08-08 11:22:30 -07:00 committed by GitHub
parent 4e58724036
commit b698927e66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@
# See https://llvm.org/LICENSE.txt for license information. # See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
package( package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
@ -20,12 +20,12 @@ config_setting(
flag_values = {":llvm_enable_zlib": "true"}, flag_values = {":llvm_enable_zlib": "true"},
) )
genrule( copy_file(
# The input template is identical to the CMake output. # The input template is identical to the CMake output.
name = "zconf_gen", name = "zconf_gen",
srcs = ["zconf.h.in"], src = "zconf.h.in",
outs = ["zconf.h"], out = "zconf.h",
cmd = "cp $(SRCS) $(OUTS)", allow_symlink = True,
) )
cc_library( cc_library(