1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
5 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
8 default_visibility = ["//visibility:public"],
9 # BSD/MIT-like license (for zlib)
10 licenses = ["notice"],
14 name = "llvm_enable_zlib",
15 build_setting_default = True,
19 name = "llvm_zlib_enabled",
20 flag_values = {":llvm_enable_zlib": "true"},
24 # The input template is identical to the CMake output.
26 srcs = ["zconf.h.in"],
28 cmd = "cp $(SRCS) $(OUTS)",
34 ":llvm_zlib_enabled": [
43 "fallback_builtins.h",
49 "insert_string_tpl.h",
79 "//conditions:default": [],
82 ":llvm_zlib_enabled": [
86 "//conditions:default": [],
93 "-DWITH_NEW_STRATEGIES",
94 # For local builds you might want to add "-DWITH_NATIVE_INSTRUCTIONS"
95 # here to improve performance. Native instructions aren't enabled in
96 # the default config for reproducibility.
99 ":llvm_zlib_enabled": [
100 "LLVM_ENABLE_ZLIB=1",
102 "//conditions:default": [],
104 # Clang includes zlib with angled instead of quoted includes, so we need
105 # strip_include_prefix here.
106 strip_include_prefix = ".",
107 visibility = ["//visibility:public"],