11# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
22# See https://llvm.org/LICENSE.txt for license information.
33# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4- load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
54load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
5+ load("@rules_cc//cc:cc_library.bzl", "cc_library")
66
77package(
88 default_visibility = ["//visibility:public"],
99 # BSD/MIT-like license (for zlib)
1010 licenses = ["notice"],
1111)
1212
13- bool_flag(
14- name = "llvm_enable_zlib",
15- build_setting_default = True,
16- )
17-
18- config_setting(
19- name = "llvm_zlib_enabled",
20- flag_values = {":llvm_enable_zlib": "true"},
21- )
22-
2313copy_file(
2414 # The input template is identical to the CMake output.
2515 name = "zconf_gen",
@@ -31,7 +21,7 @@ copy_file(
3121cc_library(
3222 name = "zlib",
3323 srcs = select({
34- ":llvm_zlib_enabled": [
24+ "@llvm-project//third-party :llvm_zlib_enabled": [
3525 "adler32.c",
3626 "adler32_p.h",
3727 "chunkset.c",
@@ -79,7 +69,7 @@ cc_library(
7969 "//conditions:default": [],
8070 }),
8171 hdrs = select({
82- ":llvm_zlib_enabled": [
72+ "@llvm-project//third-party :llvm_zlib_enabled": [
8373 "zlib.h",
8474 ":zconf_gen",
8575 ],
@@ -96,7 +86,7 @@ cc_library(
9686 # the default config for reproducibility.
9787 ],
9888 defines = select({
99- ":llvm_zlib_enabled": [
89+ "@llvm-project//third-party :llvm_zlib_enabled": [
10090 "LLVM_ENABLE_ZLIB=1",
10191 ],
10292 "//conditions:default": [],
0 commit comments