BUILD 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright (c) 2009-2021, Google LLC
  2. # All rights reserved.
  3. #
  4. # Redistribution and use in source and binary forms, with or without
  5. # modification, are permitted provided that the following conditions are met:
  6. # * Redistributions of source code must retain the above copyright
  7. # notice, this list of conditions and the following disclaimer.
  8. # * Redistributions in binary form must reproduce the above copyright
  9. # notice, this list of conditions and the following disclaimer in the
  10. # documentation and/or other materials provided with the distribution.
  11. # * Neither the name of Google LLC nor the
  12. # names of its contributors may be used to endorse or promote products
  13. # derived from this software without specific prior written permission.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. # DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
  19. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. load(
  26. "//bazel:build_defs.bzl",
  27. "UPB_DEFAULT_CPPOPTS",
  28. )
  29. licenses(["notice"])
  30. cc_library(
  31. name = "common",
  32. hdrs = ["common.h"],
  33. srcs = ["common.cc"],
  34. copts = UPB_DEFAULT_CPPOPTS,
  35. deps = [
  36. "@com_google_protobuf//:protobuf",
  37. "@com_google_absl//absl/strings",
  38. ],
  39. )
  40. cc_binary(
  41. name = "protoc-gen-upb",
  42. srcs = [
  43. "protoc-gen-upb.cc",
  44. "message_layout.cc",
  45. "message_layout.h",
  46. ],
  47. copts = UPB_DEFAULT_CPPOPTS,
  48. visibility = ["//visibility:public"],
  49. deps = [
  50. ":common",
  51. "@com_google_absl//absl/base:core_headers",
  52. "@com_google_absl//absl/container:flat_hash_map",
  53. "@com_google_absl//absl/container:flat_hash_set",
  54. "@com_google_absl//absl/strings",
  55. "@com_google_protobuf//:protobuf",
  56. "@com_google_protobuf//:protoc_lib",
  57. ],
  58. )
  59. cc_binary(
  60. name = "protoc-gen-upbdefs",
  61. srcs = [
  62. "protoc-gen-upbdefs.cc",
  63. ],
  64. copts = UPB_DEFAULT_CPPOPTS,
  65. visibility = ["//visibility:public"],
  66. deps = [
  67. ":common",
  68. "@com_google_absl//absl/base:core_headers",
  69. "@com_google_absl//absl/container:flat_hash_map",
  70. "@com_google_absl//absl/strings",
  71. "@com_google_protobuf//:protobuf",
  72. "@com_google_protobuf//:protoc_lib",
  73. ],
  74. )