Add a BUILD file under rust/accessors and rename helpers.h to default_value.h

PiperOrigin-RevId: 632535021
pull/16820/head
Protobuf Team Bot 9 months ago committed by Copybara-Service
parent c99cf4bbfa
commit 24d42eacec
  1. 65
      src/google/protobuf/compiler/rust/BUILD.bazel
  2. 45
      src/google/protobuf/compiler/rust/accessors/BUILD.bazel
  3. 2
      src/google/protobuf/compiler/rust/accessors/default_value.cc
  4. 0
      src/google/protobuf/compiler/rust/accessors/default_value.h
  5. 2
      src/google/protobuf/compiler/rust/accessors/singular_scalar.cc

@ -82,7 +82,6 @@ cc_library(
copts = COPTS,
strip_include_prefix = "/src",
deps = [
":accessors",
":context",
":enum",
":naming",
@ -90,6 +89,7 @@ cc_library(
"//src/google/protobuf",
"//src/google/protobuf/compiler/cpp:names",
"//src/google/protobuf/compiler/cpp:names_internal",
"//src/google/protobuf/compiler/rust/accessors",
"//upb_generator:mangle",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
@ -98,46 +98,15 @@ cc_library(
],
)
cc_library(
name = "accessors",
srcs = [
"accessors/accessor_case.cc",
"accessors/accessors.cc",
"accessors/map.cc",
"accessors/repeated_field.cc",
"accessors/singular_message.cc",
"accessors/singular_scalar.cc",
"accessors/singular_string.cc",
"accessors/unsupported_field.cc",
],
hdrs = [
"accessors/accessor_case.h",
"accessors/accessor_generator.h",
"accessors/accessors.h",
],
copts = COPTS,
strip_include_prefix = "/src",
deps = [
":context",
":helpers",
":naming",
":rust_field_type",
"//src/google/protobuf",
"//src/google/protobuf/compiler/cpp:names_internal",
"//src/google/protobuf/io:tokenizer",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)
cc_library(
name = "context",
srcs = ["context.cc"],
hdrs = ["context.h"],
copts = COPTS,
strip_include_prefix = "/src",
visibility = [
"//src/google/protobuf/compiler/rust:__subpackages__",
],
deps = [
"//src/google/protobuf",
"//src/google/protobuf/compiler:code_generator",
@ -195,6 +164,9 @@ cc_library(
],
copts = COPTS,
strip_include_prefix = "/src",
visibility = [
"//src/google/protobuf/compiler/rust:__subpackages__",
],
deps = [
":context",
":rust_field_type",
@ -216,13 +188,13 @@ cc_library(
copts = COPTS,
strip_include_prefix = "/src",
deps = [
":accessors",
":context",
":naming",
":rust_field_type",
"//src/google/protobuf",
"//src/google/protobuf/compiler/cpp:names",
"//src/google/protobuf/compiler/cpp:names_internal",
"//src/google/protobuf/compiler/rust/accessors",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
],
@ -250,29 +222,14 @@ cc_test(
],
)
cc_library(
name = "helpers",
srcs = ["accessors/helpers.cc"],
hdrs = ["accessors/helpers.h"],
strip_include_prefix = "/src",
deps = [
":context",
":naming",
":rust_field_type",
"//src/google/protobuf",
"//src/google/protobuf/io:tokenizer",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)
cc_library(
name = "rust_field_type",
srcs = ["rust_field_type.cc"],
hdrs = ["rust_field_type.h"],
strip_include_prefix = "/src",
visibility = [
"//src/google/protobuf/compiler/rust:__subpackages__",
],
deps = [
"//src/google/protobuf",
"@com_google_absl//absl/log:absl_log",

@ -0,0 +1,45 @@
################################################################################
# Protocol Buffers Compiler - Generation of accessors for individual fields.
################################################################################
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//build_defs:cpp_opts.bzl", "COPTS")
cc_library(
name = "accessors",
srcs = [
"accessor_case.cc",
"accessors.cc",
"default_value.cc",
"map.cc",
"repeated_field.cc",
"singular_message.cc",
"singular_scalar.cc",
"singular_string.cc",
"unsupported_field.cc",
],
hdrs = [
"accessor_case.h",
"accessor_generator.h",
"accessors.h",
"default_value.h",
],
copts = COPTS,
strip_include_prefix = "/src",
visibility = [
"//pkg:__pkg__",
"//src/google/protobuf/compiler:__subpackages__",
],
deps = [
"//src/google/protobuf",
"//src/google/protobuf/compiler/cpp:names_internal",
"//src/google/protobuf/compiler/rust:context",
"//src/google/protobuf/compiler/rust:naming",
"//src/google/protobuf/compiler/rust:rust_field_type",
"//src/google/protobuf/io:tokenizer",
"@com_google_absl//absl/log:absl_check",
"@com_google_absl//absl/log:absl_log",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
],
)

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "google/protobuf/compiler/rust/accessors/helpers.h"
#include "google/protobuf/compiler/rust/accessors/default_value.h"
#include <cmath>
#include <limits>

@ -11,7 +11,7 @@
#include "google/protobuf/compiler/cpp/helpers.h"
#include "google/protobuf/compiler/rust/accessors/accessor_case.h"
#include "google/protobuf/compiler/rust/accessors/accessor_generator.h"
#include "google/protobuf/compiler/rust/accessors/helpers.h"
#include "google/protobuf/compiler/rust/accessors/default_value.h"
#include "google/protobuf/compiler/rust/context.h"
#include "google/protobuf/compiler/rust/naming.h"
#include "google/protobuf/descriptor.h"

Loading…
Cancel
Save