1 # Description: 2 # Brotli is a generic-purpose lossless compression algorithm. 3 4 package( 5 default_visibility = ["//visibility:public"], 6 ) 7 8 licenses(["notice"]) # MIT 9 10 exports_files(["LICENSE"]) 11 12 STRICT_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 26 filegroup( 27 name = "public_headers", 28 srcs = glob(["include/brotli/*.h"]), 29 ) 30 31 filegroup( 32 name = "common_headers", 33 srcs = glob(["common/*.h"]), 34 ) 35 36 filegroup( 37 name = "common_sources", 38 srcs = glob(["common/*.c"]), 39 ) 40 41 filegroup( 42 name = "dec_headers", 43 srcs = glob(["dec/*.h"]), 44 ) 45 46 filegroup( 47 name = "dec_sources", 48 srcs = glob(["dec/*.c"]), 49 ) 50 51 filegroup( 52 name = "enc_headers", 53 srcs = glob(["enc/*.h"]), 54 ) 55 56 filegroup( 57 name = "enc_sources", 58 srcs = glob(["enc/*.c"]), 59 ) 60 61 cc_library( 62 name = "brotli", 63 hdrs = [":public_headers"], 64 copts = STRICT_C_OPTIONS, 65 includes = ["include"], 66 ) 67 68 cc_library( 69 name = "brotlicommon", 70 srcs = [":common_sources"], 71 hdrs = [":common_headers"], 72 copts = STRICT_C_OPTIONS, 73 deps = [":brotli"], 74 ) 75 76 cc_library( 77 name = "brotlidec", 78 srcs = [":dec_sources"], 79 hdrs = [":dec_headers"], 80 copts = STRICT_C_OPTIONS, 81 deps = [":brotlicommon"], 82 ) 83 84 cc_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 93 cc_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 104 load("@io_bazel_rules_go//go:def.bzl", "go_prefix") 105 106 go_prefix("github.com/google/brotli") 107