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 = "text", 14 srcs = [ 15 "encode.c", 16 ], 17 hdrs = [ 18 "encode.h", 19 "options.h", 20 ], 21 copts = UPB_DEFAULT_COPTS, 22 visibility = ["//visibility:public"], 23 deps = [ 24 ":internal", 25 "//upb:base", 26 "//upb:eps_copy_input_stream", 27 "//upb:message", 28 "//upb:port", 29 "//upb:reflection", 30 "//upb/lex", 31 "//upb/message:internal", 32 "//upb/message:types", 33 ], 34) 35 36cc_library( 37 name = "debug", 38 srcs = [ 39 "debug_string.c", 40 ], 41 hdrs = [ 42 "debug_string.h", 43 "options.h", 44 ], 45 copts = UPB_DEFAULT_COPTS, 46 visibility = ["//visibility:public"], 47 deps = [ 48 ":internal", 49 "//upb:base", 50 "//upb:eps_copy_input_stream", 51 "//upb:message", 52 "//upb:mini_table", 53 "//upb:port", 54 "//upb/lex", 55 "//upb/message:internal", 56 "//upb/message:iterator", 57 "//upb/message:types", 58 "//upb/mini_table:internal", 59 ], 60) 61 62cc_library( 63 name = "internal", 64 srcs = [ 65 "internal/encode.c", 66 ], 67 hdrs = [ 68 "internal/encode.h", 69 "options.h", 70 ], 71 copts = UPB_DEFAULT_COPTS, 72 visibility = ["//visibility:public"], 73 deps = [ 74 "//third_party/utf8_range", 75 "//upb:base", 76 "//upb:eps_copy_input_stream", 77 "//upb:message", 78 "//upb:port", 79 "//upb:wire_reader", 80 "//upb/lex", 81 "//upb/message:internal", 82 ], 83) 84 85cc_test( 86 name = "encode_debug_test", 87 srcs = [ 88 "encode_debug_test.cc", 89 ], 90 deps = [ 91 ":debug", 92 "//upb:base", 93 "//upb:eps_copy_input_stream", 94 "//upb:mem", 95 "//upb:message", 96 "//upb:mini_table", 97 "//upb:port", 98 "//upb:wire_reader", 99 "//upb/message:internal", 100 "//upb/test:test_proto_upb_minitable", 101 "//upb/test:test_upb_proto", 102 "@com_google_absl//absl/log:absl_log", 103 "@com_google_googletest//:gtest", 104 "@com_google_googletest//:gtest_main", 105 ], 106) 107 108filegroup( 109 name = "source_files", 110 srcs = glob( 111 [ 112 "**/*.c", 113 "**/*.h", 114 ], 115 ), 116 visibility = [ 117 "//python/dist:__pkg__", 118 "//upb/cmake:__pkg__", 119 ], 120) 121