brotli/BUILD.bazel

142 lines
2.6 KiB
Python
Raw Permalink Normal View History

# Description:
# Brotli is a generic-purpose lossless compression algorithm.
package(
default_visibility = ["//visibility:public"],
)
licenses(["notice"]) # MIT
exports_files(["LICENSE"])
config_setting(
name = "clang-cl",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "clang-cl",
},
visibility = ["//visibility:public"],
)
config_setting(
name = "msvc",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
},
visibility = ["//visibility:public"],
)
STRICT_C_OPTIONS = select({
":msvc": [],
":clang-cl": [
"/W4",
"-Wconversion",
"-Wlong-long",
"-Wmissing-declarations",
"-Wmissing-prototypes",
"-Wno-strict-aliasing",
"-Wshadow",
"-Wsign-compare",
"-Wno-sign-conversion",
],
"//conditions:default": [
"--pedantic-errors",
"-Wall",
"-Wconversion",
"-Werror",
"-Wextra",
"-Wlong-long",
"-Wmissing-declarations",
"-Wmissing-prototypes",
"-Wno-strict-aliasing",
"-Wshadow",
"-Wsign-compare",
],
})
filegroup(
name = "public_headers",
srcs = glob(["c/include/brotli/*.h"]),
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "common_headers",
srcs = glob(["c/common/*.h"]),
2016-06-24 21:32:51 +08:00
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "common_sources",
srcs = glob(["c/common/*.c"]),
2016-06-24 21:32:51 +08:00
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "dec_headers",
srcs = glob(["c/dec/*.h"]),
2016-06-24 21:32:51 +08:00
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "dec_sources",
srcs = glob(["c/dec/*.c"]),
2016-06-24 21:32:51 +08:00
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "enc_headers",
srcs = glob(["c/enc/*.h"]),
2016-06-24 21:32:51 +08:00
)
2016-06-24 21:32:51 +08:00
filegroup(
name = "enc_sources",
srcs = glob(["c/enc/*.c"]),
2016-06-24 21:32:51 +08:00
)
cc_library(
name = "brotli_inc",
2016-08-23 20:40:33 +08:00
hdrs = [":public_headers"],
copts = STRICT_C_OPTIONS,
strip_include_prefix = "c/include",
2016-08-23 20:40:33 +08:00
)
cc_library(
name = "brotlicommon",
2016-06-24 21:32:51 +08:00
srcs = [":common_sources"],
2016-08-23 20:40:33 +08:00
hdrs = [":common_headers"],
copts = STRICT_C_OPTIONS,
deps = [":brotli_inc"],
)
cc_library(
name = "brotlidec",
2016-06-24 21:32:51 +08:00
srcs = [":dec_sources"],
2016-08-23 20:40:33 +08:00
hdrs = [":dec_headers"],
copts = STRICT_C_OPTIONS,
deps = [":brotlicommon"],
)
cc_library(
name = "brotlienc",
2016-06-24 21:32:51 +08:00
srcs = [":enc_sources"],
2016-08-23 20:40:33 +08:00
hdrs = [":enc_headers"],
copts = STRICT_C_OPTIONS,
linkopts = select({
":clang-cl": [],
":msvc": [],
"//conditions:default": ["-lm"],
}),
deps = [":brotlicommon"],
)
cc_binary(
name = "brotli",
srcs = ["c/tools/brotli.c"],
copts = STRICT_C_OPTIONS,
2016-06-24 21:32:51 +08:00
linkstatic = 1,
deps = [
":brotlidec",
":brotlienc",
],
)
2017-06-01 19:51:18 +08:00
filegroup(
name = "dictionary",
srcs = ["c/common/dictionary.bin"],
)