# Copyright Materialize, Inc. and contributors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License in the LICENSE file at the # root of this repository, or online at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Builds zlib. Derived from: """ cc_library( name = "zlib", srcs = [ "src/zlib/adler32.c", "src/zlib/compress.c", "src/zlib/crc32.c", "src/zlib/deflate.c", "src/zlib/infback.c", "src/zlib/inffast.c", "src/zlib/inflate.c", "src/zlib/inftrees.c", "src/zlib/trees.c", "src/zlib/uncompr.c", "src/zlib/zutil.c", ], hdrs = [ "src/zlib/crc32.h", "src/zlib/deflate.h", "src/zlib/inffast.h", "src/zlib/inffixed.h", "src/zlib/inflate.h", "src/zlib/inftrees.h", "src/zlib/trees.h", "src/zlib/zconf.h", "src/zlib/zlib.h", "src/zlib/zutil.h", ], copts = select({ "//conditions:default": [ "-Wno-unused-variable", "-Wno-implicit-function-declaration", "-Wno-deprecated-non-prototype", "-Wno-macro-redefined", "-fvisibility=hidden", ], }), includes = ["src/zlib"], local_defines = [ "Z_SOLO", "STDC", "_LARGEFILE64_SOURCE", "_POSIX_SOURCE", ] + select({ "@platforms//os:macos": [ "_C99_SOURCE", ], "//conditions:default": [], }), visibility = ["//visibility:public"], )