xref: /aosp_15_r20/external/perfetto/bazel/zlib.BUILD (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("@perfetto_cfg//:perfetto_cfg.bzl", "PERFETTO_CONFIG")
16
17cc_library(
18    name = "zlib",
19    srcs = [
20        "adler32.c",
21        "chromeconf.h",
22        "compress.c",
23        "contrib/optimizations/insert_string.h",
24        "cpu_features.c",
25        "cpu_features.h",
26        "crc32.c",
27        "crc32.h",
28        "deflate.c",
29        "deflate.h",
30        "gzclose.c",
31        "gzguts.h",
32        "gzlib.c",
33        "gzread.c",
34        "gzwrite.c",
35        "infback.c",
36        "inffast.c",
37        "inffast.h",
38        "inffixed.h",
39        "inflate.c",
40        "inflate.h",
41        "inftrees.c",
42        "inftrees.h",
43        "trees.c",
44        "trees.h",
45        "uncompr.c",
46        "zconf.h",
47        "zutil.c",
48        "zutil.h",
49    ],
50    hdrs = [
51        "zlib.h",
52    ],
53    copts = select({
54      "@perfetto//bazel:os_windows": ["-DX86_WINDOWS"],
55      "//conditions:default": [],
56    }) + [
57        "-Wno-unused-function",
58        "-DZLIB_IMPLEMENTATION",
59        "-DCHROMIUM_ZLIB_NO_CHROMECONF",
60    ] + PERFETTO_CONFIG.deps_copts.zlib,
61    includes = ["zlib"],
62    visibility = ["//visibility:public"],
63)
64