-
Notifications
You must be signed in to change notification settings - Fork 397
/
Copy pathBUILD.bazel
122 lines (112 loc) · 4.36 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load(":google_cloud_cpp_generator.bzl", "google_cloud_cpp_generator_hdrs", "google_cloud_cpp_generator_srcs")
load(":google_cloud_cpp_generator_testing.bzl", "google_cloud_cpp_generator_testing_hdrs", "google_cloud_cpp_generator_testing_srcs")
load(":google_cloud_cpp_generator_unit_tests.bzl", "google_cloud_cpp_generator_unit_tests")
package(default_visibility = ["//visibility:private"])
licenses(["notice"]) # Apache 2.0
cc_library(
name = "google_cloud_cpp_generator",
srcs = google_cloud_cpp_generator_srcs,
hdrs = google_cloud_cpp_generator_hdrs,
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
":generator_config_cc_proto",
"//:common",
"//google/cloud:google_cloud_cpp_rest_internal",
"@com_github_jbeder_yaml_cpp//:yaml-cpp",
"@com_github_nlohmann_json//:json",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_googleapis//google/api:client_cc_proto",
"@com_google_googleapis//google/api:field_info_cc_proto",
"@com_google_googleapis//google/api:routing_cc_proto",
"@com_google_googleapis//google/cloud:extended_operations_cc_proto",
"@com_google_googleapis//google/longrunning:longrunning_cc_proto",
"@com_google_protobuf//:protoc_lib",
],
)
cc_library(
name = "google_cloud_cpp_generator_testing",
testonly = True,
srcs = google_cloud_cpp_generator_testing_srcs,
hdrs = google_cloud_cpp_generator_testing_hdrs,
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
":google_cloud_cpp_generator",
"//:common",
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
"@com_google_googleapis//google/longrunning:longrunning_cc_proto",
"@com_google_googletest//:gtest",
],
)
[cc_test(
name = test.replace("/", "_").replace(".cc", ""),
srcs = [test],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
":google_cloud_cpp_generator",
":google_cloud_cpp_generator_testing",
"//google/cloud/testing_util:google_cloud_cpp_testing_grpc_private",
"@com_google_googletest//:gtest",
],
) for test in google_cloud_cpp_generator_unit_tests]
cc_binary(
name = "protoc-gen-cpp_codegen",
srcs = ["plugin_main.cc"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [":google_cloud_cpp_generator"],
)
proto_library(
name = "generator_config_proto",
srcs = ["generator_config.proto"],
)
cc_proto_library(
name = "generator_config_cc_proto",
deps = [":generator_config_proto"],
)
cc_binary(
name = "google-cloud-cpp-codegen",
srcs = ["standalone_main.cc"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [
":generator_config_cc_proto",
":google_cloud_cpp_generator",
"@com_google_absl//absl/flags:commandlineflag",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
],
)