2016-06-16 08:52:57 +00:00
|
|
|
# Description:
|
|
|
|
# Brotli is a generic-purpose lossless compression algorithm.
|
|
|
|
|
|
|
|
package(
|
|
|
|
default_visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
licenses(["notice"]) # MIT
|
|
|
|
|
2016-08-24 02:58:51 +00:00
|
|
|
exports_files(["LICENSE"])
|
|
|
|
|
2016-06-17 14:24:51 +00:00
|
|
|
STRICT_C_OPTIONS = [
|
2016-06-16 08:52:57 +00:00
|
|
|
"--pedantic-errors",
|
|
|
|
"-Wall",
|
|
|
|
"-Wconversion",
|
|
|
|
"-Werror",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wlong-long",
|
|
|
|
"-Wmissing-declarations",
|
2016-06-17 14:24:51 +00:00
|
|
|
"-Wmissing-prototypes",
|
2016-06-16 08:52:57 +00:00
|
|
|
"-Wno-strict-aliasing",
|
|
|
|
"-Wshadow",
|
|
|
|
"-Wsign-compare",
|
|
|
|
]
|
|
|
|
|
2016-08-22 11:28:22 +00:00
|
|
|
filegroup(
|
|
|
|
name = "public_headers",
|
2016-08-23 12:40:33 +00:00
|
|
|
srcs = glob(["include/brotli/*.h"]),
|
2016-08-22 11:28:22 +00:00
|
|
|
)
|
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "common_headers",
|
|
|
|
srcs = glob(["common/*.h"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "common_sources",
|
|
|
|
srcs = glob(["common/*.c"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "dec_headers",
|
|
|
|
srcs = glob(["dec/*.h"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "dec_sources",
|
|
|
|
srcs = glob(["dec/*.c"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "enc_headers",
|
|
|
|
srcs = glob(["enc/*.h"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-06-24 13:32:51 +00:00
|
|
|
filegroup(
|
|
|
|
name = "enc_sources",
|
|
|
|
srcs = glob(["enc/*.c"]),
|
|
|
|
)
|
2016-06-16 08:52:57 +00:00
|
|
|
|
2016-08-23 22:43:07 +00:00
|
|
|
cc_library(
|
2016-08-23 12:40:33 +00:00
|
|
|
name = "brotli",
|
|
|
|
hdrs = [":public_headers"],
|
2016-08-23 22:43:07 +00:00
|
|
|
copts = STRICT_C_OPTIONS,
|
|
|
|
includes = ["include"],
|
2016-08-23 12:40:33 +00:00
|
|
|
)
|
|
|
|
|
2016-06-16 08:52:57 +00:00
|
|
|
cc_library(
|
2016-10-12 16:23:34 +00:00
|
|
|
name = "brotlicommon",
|
2016-06-24 13:32:51 +00:00
|
|
|
srcs = [":common_sources"],
|
2016-08-23 12:40:33 +00:00
|
|
|
hdrs = [":common_headers"],
|
2016-06-16 08:52:57 +00:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-08-23 22:43:07 +00:00
|
|
|
deps = [":brotli"],
|
2016-06-16 08:52:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2016-10-12 16:23:34 +00:00
|
|
|
name = "brotlidec",
|
2016-06-24 13:32:51 +00:00
|
|
|
srcs = [":dec_sources"],
|
2016-08-23 12:40:33 +00:00
|
|
|
hdrs = [":dec_headers"],
|
2016-06-16 08:52:57 +00:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-10-12 16:23:34 +00:00
|
|
|
deps = [":brotlicommon"],
|
2016-06-16 08:52:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2016-10-12 16:23:34 +00:00
|
|
|
name = "brotlienc",
|
2016-06-24 13:32:51 +00:00
|
|
|
srcs = [":enc_sources"],
|
2016-08-23 12:40:33 +00:00
|
|
|
hdrs = [":enc_headers"],
|
2016-06-16 08:52:57 +00:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-08-29 09:32:12 +00:00
|
|
|
linkopts = ["-lm"],
|
2016-10-12 16:23:34 +00:00
|
|
|
deps = [":brotlicommon"],
|
2016-06-16 08:52:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "bro",
|
2016-06-17 14:24:51 +00:00
|
|
|
srcs = ["tools/bro.c"],
|
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-06-24 13:32:51 +00:00
|
|
|
linkstatic = 1,
|
2016-06-16 08:52:57 +00:00
|
|
|
deps = [
|
2016-10-12 16:23:34 +00:00
|
|
|
":brotlidec",
|
|
|
|
":brotlienc",
|
2016-06-16 08:52:57 +00:00
|
|
|
],
|
|
|
|
)
|