1# Copyright (c) 2009-2021, Google LLC 2# All rights reserved. 3# 4# Use of this source code is governed by a BSD-style 5# license that can be found in the LICENSE file or at 6# https://developers.google.com/open-source/licenses/bsd 7 8load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") 9 10package(default_applicable_licenses = ["//:license"]) 11 12cc_library( 13 name = "wire", 14 srcs = [ 15 "decode.c", 16 "encode.c", 17 "internal/constants.h", 18 "internal/decode_fast.c", 19 "internal/decoder.h", 20 ], 21 hdrs = [ 22 "decode.h", 23 "encode.h", 24 "internal/decode_fast.h", 25 ], 26 copts = UPB_DEFAULT_COPTS, 27 visibility = ["//visibility:public"], 28 deps = [ 29 ":eps_copy_input_stream", 30 ":reader", 31 "//third_party/utf8_range", 32 "//upb:base", 33 "//upb:mem", 34 "//upb:message", 35 "//upb:mini_table", 36 "//upb:port", 37 "//upb/base:internal", 38 "//upb/hash", 39 "//upb/mem:internal", 40 "//upb/message:internal", 41 "//upb/message:types", 42 "//upb/mini_table:internal", 43 ], 44) 45 46cc_library( 47 name = "reader", 48 srcs = [ 49 "internal/reader.h", 50 "reader.c", 51 ], 52 hdrs = [ 53 "reader.h", 54 "types.h", 55 ], 56 visibility = ["//visibility:public"], 57 deps = [ 58 ":eps_copy_input_stream", 59 "//upb:port", 60 "//upb/base:internal", 61 ], 62) 63 64cc_library( 65 name = "byte_size", 66 srcs = ["byte_size.c"], 67 hdrs = ["byte_size.h"], 68 visibility = ["//visibility:public"], 69 deps = [ 70 "//upb:mem", 71 "//upb:message", 72 "//upb:mini_table", 73 "//upb:port", 74 "//upb:wire", 75 ], 76) 77 78cc_test( 79 name = "byte_size_test", 80 srcs = ["byte_size_test.cc"], 81 deps = [ 82 ":byte_size", 83 "//upb:base", 84 "//upb:mem", 85 "//upb:mini_table", 86 "//upb/test:test_messages_proto2_upb_minitable", 87 "//upb/test:test_messages_proto2_upb_proto", 88 "@com_google_googletest//:gtest", 89 "@com_google_googletest//:gtest_main", 90 ], 91) 92 93cc_library( 94 name = "eps_copy_input_stream", 95 srcs = ["eps_copy_input_stream.c"], 96 hdrs = ["eps_copy_input_stream.h"], 97 visibility = ["//visibility:public"], 98 deps = [ 99 "//upb:mem", 100 "//upb:port", 101 ], 102) 103 104cc_test( 105 name = "eps_copy_input_stream_test", 106 srcs = ["eps_copy_input_stream_test.cc"], 107 deps = [ 108 ":eps_copy_input_stream", 109 "//upb:mem", 110 "@com_google_googletest//:gtest", 111 "@com_google_googletest//:gtest_main", 112 ], 113) 114 115filegroup( 116 name = "source_files", 117 srcs = glob( 118 [ 119 "**/*.c", 120 "**/*.h", 121 ], 122 ), 123 visibility = [ 124 "//python/dist:__pkg__", 125 "//upb/cmake:__pkg__", 126 ], 127) 128 129filegroup( 130 name = "test_srcs", 131 srcs = glob( 132 [ 133 "**/*test.cc", 134 ], 135 ), 136 visibility = ["//upb:__pkg__"], 137) 138