2016-06-16 16:52:57 +08:00
|
|
|
# Description:
|
|
|
|
# Brotli is a generic-purpose lossless compression algorithm.
|
|
|
|
|
|
|
|
package(
|
|
|
|
default_visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
licenses(["notice"]) # MIT
|
|
|
|
|
2016-08-24 10:58:51 +08:00
|
|
|
exports_files(["LICENSE"])
|
|
|
|
|
2017-05-29 23:55:14 +08:00
|
|
|
config_setting(
|
2024-01-04 19:32:33 +08:00
|
|
|
name = "clang-cl",
|
|
|
|
flag_values = {
|
|
|
|
"@bazel_tools//tools/cpp:compiler": "clang-cl",
|
|
|
|
},
|
2017-10-12 04:26:37 +08:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
config_setting(
|
2024-01-04 19:32:33 +08:00
|
|
|
name = "msvc",
|
|
|
|
flag_values = {
|
|
|
|
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
|
|
|
|
},
|
2017-10-12 04:26:37 +08:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
2018-03-29 16:37:07 +08:00
|
|
|
STRICT_C_OPTIONS = select({
|
|
|
|
":msvc": [],
|
2023-07-04 03:13:24 +08:00
|
|
|
":clang-cl": [
|
|
|
|
"/W4",
|
|
|
|
"-Wconversion",
|
|
|
|
"-Wlong-long",
|
|
|
|
"-Wmissing-declarations",
|
|
|
|
"-Wmissing-prototypes",
|
|
|
|
"-Wno-strict-aliasing",
|
|
|
|
"-Wshadow",
|
|
|
|
"-Wsign-compare",
|
|
|
|
"-Wno-sign-conversion",
|
|
|
|
],
|
2018-03-29 16:37:07 +08:00
|
|
|
"//conditions:default": [
|
|
|
|
"--pedantic-errors",
|
|
|
|
"-Wall",
|
|
|
|
"-Wconversion",
|
|
|
|
"-Werror",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wlong-long",
|
|
|
|
"-Wmissing-declarations",
|
|
|
|
"-Wmissing-prototypes",
|
|
|
|
"-Wno-strict-aliasing",
|
|
|
|
"-Wshadow",
|
|
|
|
"-Wsign-compare",
|
|
|
|
],
|
|
|
|
})
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-08-22 19:28:22 +08:00
|
|
|
filegroup(
|
|
|
|
name = "public_headers",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/include/brotli/*.h"]),
|
2016-08-22 19:28:22 +08:00
|
|
|
)
|
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "common_headers",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/common/*.h"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "common_sources",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/common/*.c"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "dec_headers",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/dec/*.h"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "dec_sources",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/dec/*.c"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "enc_headers",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/enc/*.h"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
filegroup(
|
|
|
|
name = "enc_sources",
|
2017-04-23 20:07:08 +08:00
|
|
|
srcs = glob(["c/enc/*.c"]),
|
2016-06-24 21:32:51 +08:00
|
|
|
)
|
2016-06-16 16:52:57 +08:00
|
|
|
|
2016-08-24 06:43:07 +08:00
|
|
|
cc_library(
|
2017-05-29 23:55:14 +08:00
|
|
|
name = "brotli_inc",
|
2016-08-23 20:40:33 +08:00
|
|
|
hdrs = [":public_headers"],
|
2016-08-24 06:43:07 +08:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2019-07-16 23:49:14 +08:00
|
|
|
strip_include_prefix = "c/include",
|
2016-08-23 20:40:33 +08:00
|
|
|
)
|
|
|
|
|
2016-06-16 16:52:57 +08:00
|
|
|
cc_library(
|
2016-10-13 00:23:34 +08:00
|
|
|
name = "brotlicommon",
|
2016-06-24 21:32:51 +08:00
|
|
|
srcs = [":common_sources"],
|
2016-08-23 20:40:33 +08:00
|
|
|
hdrs = [":common_headers"],
|
2016-06-16 16:52:57 +08:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2017-05-29 23:55:14 +08:00
|
|
|
deps = [":brotli_inc"],
|
2016-06-16 16:52:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2016-10-13 00:23:34 +08:00
|
|
|
name = "brotlidec",
|
2016-06-24 21:32:51 +08:00
|
|
|
srcs = [":dec_sources"],
|
2016-08-23 20:40:33 +08:00
|
|
|
hdrs = [":dec_headers"],
|
2016-06-16 16:52:57 +08:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-10-13 00:23:34 +08:00
|
|
|
deps = [":brotlicommon"],
|
2016-06-16 16:52:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2016-10-13 00:23:34 +08:00
|
|
|
name = "brotlienc",
|
2016-06-24 21:32:51 +08:00
|
|
|
srcs = [":enc_sources"],
|
2016-08-23 20:40:33 +08:00
|
|
|
hdrs = [":enc_headers"],
|
2016-06-16 16:52:57 +08:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2020-09-08 22:48:31 +08:00
|
|
|
linkopts = select({
|
2023-07-04 03:13:24 +08:00
|
|
|
":clang-cl": [],
|
2020-09-08 22:48:31 +08:00
|
|
|
":msvc": [],
|
|
|
|
"//conditions:default": ["-lm"],
|
|
|
|
}),
|
2016-10-13 00:23:34 +08:00
|
|
|
deps = [":brotlicommon"],
|
2016-06-16 16:52:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
2017-05-29 23:55:14 +08:00
|
|
|
name = "brotli",
|
|
|
|
srcs = ["c/tools/brotli.c"],
|
2016-06-17 22:24:51 +08:00
|
|
|
copts = STRICT_C_OPTIONS,
|
2016-06-24 21:32:51 +08:00
|
|
|
linkstatic = 1,
|
2016-06-16 16:52:57 +08:00
|
|
|
deps = [
|
2016-10-13 00:23:34 +08:00
|
|
|
":brotlidec",
|
|
|
|
":brotlienc",
|
2016-06-16 16:52:57 +08:00
|
|
|
],
|
|
|
|
)
|
2017-03-22 19:41:19 +08:00
|
|
|
|
2017-06-01 19:51:18 +08:00
|
|
|
filegroup(
|
|
|
|
name = "dictionary",
|
|
|
|
srcs = ["c/common/dictionary.bin"],
|
|
|
|
)
|