• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Description:
2#   Brotli is a generic-purpose lossless compression algorithm.
3
4package(
5    default_visibility = ["//visibility:public"],
6)
7
8licenses(["notice"])  # MIT
9
10exports_files(["LICENSE"])
11
12STRICT_C_OPTIONS = [
13    "--pedantic-errors",
14    "-Wall",
15    "-Wconversion",
16    "-Werror",
17    "-Wextra",
18    "-Wlong-long",
19    "-Wmissing-declarations",
20    "-Wmissing-prototypes",
21    "-Wno-strict-aliasing",
22    "-Wshadow",
23    "-Wsign-compare",
24]
25
26filegroup(
27    name = "public_headers",
28    srcs = glob(["include/brotli/*.h"]),
29)
30
31filegroup(
32    name = "common_headers",
33    srcs = glob(["common/*.h"]),
34)
35
36filegroup(
37    name = "common_sources",
38    srcs = glob(["common/*.c"]),
39)
40
41filegroup(
42    name = "dec_headers",
43    srcs = glob(["dec/*.h"]),
44)
45
46filegroup(
47    name = "dec_sources",
48    srcs = glob(["dec/*.c"]),
49)
50
51filegroup(
52    name = "enc_headers",
53    srcs = glob(["enc/*.h"]),
54)
55
56filegroup(
57    name = "enc_sources",
58    srcs = glob(["enc/*.c"]),
59)
60
61cc_library(
62    name = "brotli",
63    hdrs = [":public_headers"],
64    copts = STRICT_C_OPTIONS,
65    includes = ["include"],
66)
67
68cc_library(
69    name = "brotlicommon",
70    srcs = [":common_sources"],
71    hdrs = [":common_headers"],
72    copts = STRICT_C_OPTIONS,
73    deps = [":brotli"],
74)
75
76cc_library(
77    name = "brotlidec",
78    srcs = [":dec_sources"],
79    hdrs = [":dec_headers"],
80    copts = STRICT_C_OPTIONS,
81    deps = [":brotlicommon"],
82)
83
84cc_library(
85    name = "brotlienc",
86    srcs = [":enc_sources"],
87    hdrs = [":enc_headers"],
88    copts = STRICT_C_OPTIONS,
89    linkopts = ["-lm"],
90    deps = [":brotlicommon"],
91)
92
93cc_binary(
94    name = "bro",
95    srcs = ["tools/bro.c"],
96    copts = STRICT_C_OPTIONS,
97    linkstatic = 1,
98    deps = [
99        ":brotlidec",
100        ":brotlienc",
101    ],
102)
103
104load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
105
106go_prefix("github.com/google/brotli")
107