• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//developtools/profiler/build/config.gni")
15import("$build_root/ark.gni")
16
17THIRDPARTY_PROTOBUF_SUBSYS_NAME = "thirdparty"
18THIRDPARTY_PROTOBUF_PART_NAME = "protobuf"
19protobuf_src_root = "//third_party/protobuf/src"
20
21config("protobuf_config") {
22  include_dirs = [ "protobuf_src_root" ]
23}
24
25ohos_shared_library("protobuf_lite") {
26  sources = [
27    "$protobuf_src_root/google/protobuf/any_lite.cc",
28    "$protobuf_src_root/google/protobuf/arena.cc",
29    "$protobuf_src_root/google/protobuf/extension_set.cc",
30    "$protobuf_src_root/google/protobuf/generated_enum_util.cc",
31    "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc",
32    "$protobuf_src_root/google/protobuf/generated_message_util.cc",
33    "$protobuf_src_root/google/protobuf/implicit_weak_message.cc",
34    "$protobuf_src_root/google/protobuf/io/coded_stream.cc",
35    "$protobuf_src_root/google/protobuf/io/io_win32.cc",
36    "$protobuf_src_root/google/protobuf/io/strtod.cc",
37    "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc",
38    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc",
39    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc",
40    "$protobuf_src_root/google/protobuf/message_lite.cc",
41    "$protobuf_src_root/google/protobuf/parse_context.cc",
42    "$protobuf_src_root/google/protobuf/repeated_field.cc",
43    "$protobuf_src_root/google/protobuf/stubs/bytestream.cc",
44    "$protobuf_src_root/google/protobuf/stubs/common.cc",
45    "$protobuf_src_root/google/protobuf/stubs/int128.cc",
46    "$protobuf_src_root/google/protobuf/stubs/status.cc",
47    "$protobuf_src_root/google/protobuf/stubs/statusor.cc",
48    "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc",
49    "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc",
50    "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc",
51    "$protobuf_src_root/google/protobuf/stubs/strutil.cc",
52    "$protobuf_src_root/google/protobuf/stubs/time.cc",
53    "$protobuf_src_root/google/protobuf/wire_format_lite.cc",
54  ]
55  if (!is_asan && !is_debug) {
56    version_script = "libprotobuf_lite.map"
57  }
58  include_dirs = [
59    "$protobuf_src_root/google/protobuf/**/*.h",
60    "$protobuf_src_root/google/protobuf/**/*.inc",
61    "$protobuf_src_root",
62  ]
63  if (!is_mingw) {
64    if (current_toolchain != host_toolchain) {
65      external_deps = [ "hilog:libhilog" ]
66    }
67  } else {
68    defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ]
69  }
70
71  cflags_cc = [ "-Wno-sign-compare" ]
72  cflags = [
73    "-Wno-sign-compare",
74    "-D HAVE_PTHREAD",
75  ]
76
77  public_configs = [ ":protobuf_config" ]
78  install_enable = true
79  innerapi_tags = [ "platformsdk_indirect" ]
80  subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
81  part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
82}
83
84ohos_static_library("protobuf_lite_static") {
85  sources = [
86    "$protobuf_src_root/google/protobuf/any_lite.cc",
87    "$protobuf_src_root/google/protobuf/arena.cc",
88    "$protobuf_src_root/google/protobuf/extension_set.cc",
89    "$protobuf_src_root/google/protobuf/generated_enum_util.cc",
90    "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc",
91    "$protobuf_src_root/google/protobuf/generated_message_util.cc",
92    "$protobuf_src_root/google/protobuf/implicit_weak_message.cc",
93    "$protobuf_src_root/google/protobuf/io/coded_stream.cc",
94    "$protobuf_src_root/google/protobuf/io/io_win32.cc",
95    "$protobuf_src_root/google/protobuf/io/strtod.cc",
96    "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc",
97    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc",
98    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc",
99    "$protobuf_src_root/google/protobuf/message_lite.cc",
100    "$protobuf_src_root/google/protobuf/parse_context.cc",
101    "$protobuf_src_root/google/protobuf/repeated_field.cc",
102    "$protobuf_src_root/google/protobuf/stubs/bytestream.cc",
103    "$protobuf_src_root/google/protobuf/stubs/common.cc",
104    "$protobuf_src_root/google/protobuf/stubs/int128.cc",
105    "$protobuf_src_root/google/protobuf/stubs/status.cc",
106    "$protobuf_src_root/google/protobuf/stubs/statusor.cc",
107    "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc",
108    "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc",
109    "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc",
110    "$protobuf_src_root/google/protobuf/stubs/strutil.cc",
111    "$protobuf_src_root/google/protobuf/stubs/time.cc",
112    "$protobuf_src_root/google/protobuf/wire_format_lite.cc",
113  ]
114  include_dirs = [
115    "$protobuf_src_root/google/protobuf/**/*.h",
116    "$protobuf_src_root/google/protobuf/**/*.inc",
117    "$protobuf_src_root",
118  ]
119  if (!is_mingw) {
120    if (current_toolchain != host_toolchain) {
121      # target build, not host build
122      defines = [ "HAVE_HILOG" ]
123      external_deps = [ "hilog:libhilog" ]
124    }
125  } else {
126    defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ]
127  }
128
129  cflags_cc = [
130    "-Wno-sign-compare",
131    "-Wno-deprecated-declarations",
132  ]
133  cflags = [
134    "-Wno-deprecated-declarations",
135    "-Wno-sign-compare",
136    "-D HAVE_PTHREAD",
137  ]
138  if (is_mingw) {
139    # ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:60:9: error: 'lseek' macro redefined [-Werror,-Wmacro-redefined]
140    cflags += [ "-Wno-macro-redefined" ]
141  }
142  public_configs = [ ":protobuf_config" ]
143  subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
144  part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
145}
146
147ohos_shared_library("protobuf") {
148  sources = [
149    "$protobuf_src_root/google/protobuf/any.cc",
150    "$protobuf_src_root/google/protobuf/any.pb.cc",
151    "$protobuf_src_root/google/protobuf/api.pb.cc",
152    "$protobuf_src_root/google/protobuf/compiler/importer.cc",
153    "$protobuf_src_root/google/protobuf/compiler/parser.cc",
154    "$protobuf_src_root/google/protobuf/descriptor.cc",
155    "$protobuf_src_root/google/protobuf/descriptor.pb.cc",
156    "$protobuf_src_root/google/protobuf/descriptor_database.cc",
157    "$protobuf_src_root/google/protobuf/duration.pb.cc",
158    "$protobuf_src_root/google/protobuf/dynamic_message.cc",
159    "$protobuf_src_root/google/protobuf/empty.pb.cc",
160    "$protobuf_src_root/google/protobuf/extension_set_heavy.cc",
161    "$protobuf_src_root/google/protobuf/field_mask.pb.cc",
162    "$protobuf_src_root/google/protobuf/generated_message_reflection.cc",
163    "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc",
164    "$protobuf_src_root/google/protobuf/io/gzip_stream.cc",
165    "$protobuf_src_root/google/protobuf/io/printer.cc",
166    "$protobuf_src_root/google/protobuf/io/tokenizer.cc",
167    "$protobuf_src_root/google/protobuf/map_field.cc",
168    "$protobuf_src_root/google/protobuf/message.cc",
169    "$protobuf_src_root/google/protobuf/reflection_ops.cc",
170    "$protobuf_src_root/google/protobuf/service.cc",
171    "$protobuf_src_root/google/protobuf/source_context.pb.cc",
172    "$protobuf_src_root/google/protobuf/struct.pb.cc",
173    "$protobuf_src_root/google/protobuf/stubs/substitute.cc",
174    "$protobuf_src_root/google/protobuf/text_format.cc",
175    "$protobuf_src_root/google/protobuf/timestamp.pb.cc",
176    "$protobuf_src_root/google/protobuf/type.pb.cc",
177    "$protobuf_src_root/google/protobuf/unknown_field_set.cc",
178    "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc",
179    "$protobuf_src_root/google/protobuf/util/field_comparator.cc",
180    "$protobuf_src_root/google/protobuf/util/field_mask_util.cc",
181    "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc",
182    "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc",
183    "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc",
184    "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc",
185    "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc",
186    "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc",
187    "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc",
188    "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc",
189    "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc",
190    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc",
191    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc",
192    "$protobuf_src_root/google/protobuf/util/internal/type_info.cc",
193    "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc",
194    "$protobuf_src_root/google/protobuf/util/internal/utility.cc",
195    "$protobuf_src_root/google/protobuf/util/json_util.cc",
196    "$protobuf_src_root/google/protobuf/util/message_differencer.cc",
197    "$protobuf_src_root/google/protobuf/util/time_util.cc",
198    "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc",
199    "$protobuf_src_root/google/protobuf/wire_format.cc",
200    "$protobuf_src_root/google/protobuf/wrappers.pb.cc",
201  ]
202  include_dirs = [
203    "$protobuf_src_root/google/protobuf/**/*.h",
204    "$protobuf_src_root/google/protobuf/**/*.inc",
205    "$protobuf_src_root",
206  ]
207  cflags_cc = [
208    "-Wno-sign-compare",
209    "-Wno-deprecated-declarations",
210  ]
211  cflags = [
212    "-Wno-sign-compare",
213    "-D HAVE_PTHREAD",
214    "-Wno-deprecated-declarations",
215  ]
216
217  deps = [ ":protobuf_lite" ]
218  if (!is_asan && !is_debug) {
219    version_script = "libprotobuf.map"
220  }
221
222  public_configs = [ ":protobuf_config" ]
223  install_enable = true
224  subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
225  part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
226}
227
228ohos_static_library("protobuf_static") {
229  sources = [
230    "$protobuf_src_root/google/protobuf/any.cc",
231    "$protobuf_src_root/google/protobuf/any.pb.cc",
232    "$protobuf_src_root/google/protobuf/api.pb.cc",
233    "$protobuf_src_root/google/protobuf/compiler/importer.cc",
234    "$protobuf_src_root/google/protobuf/compiler/parser.cc",
235    "$protobuf_src_root/google/protobuf/descriptor.cc",
236    "$protobuf_src_root/google/protobuf/descriptor.pb.cc",
237    "$protobuf_src_root/google/protobuf/descriptor_database.cc",
238    "$protobuf_src_root/google/protobuf/duration.pb.cc",
239    "$protobuf_src_root/google/protobuf/dynamic_message.cc",
240    "$protobuf_src_root/google/protobuf/empty.pb.cc",
241    "$protobuf_src_root/google/protobuf/extension_set_heavy.cc",
242    "$protobuf_src_root/google/protobuf/field_mask.pb.cc",
243    "$protobuf_src_root/google/protobuf/generated_message_reflection.cc",
244    "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc",
245    "$protobuf_src_root/google/protobuf/io/gzip_stream.cc",
246    "$protobuf_src_root/google/protobuf/io/printer.cc",
247    "$protobuf_src_root/google/protobuf/io/tokenizer.cc",
248    "$protobuf_src_root/google/protobuf/map_field.cc",
249    "$protobuf_src_root/google/protobuf/message.cc",
250    "$protobuf_src_root/google/protobuf/reflection_ops.cc",
251    "$protobuf_src_root/google/protobuf/service.cc",
252    "$protobuf_src_root/google/protobuf/source_context.pb.cc",
253    "$protobuf_src_root/google/protobuf/struct.pb.cc",
254    "$protobuf_src_root/google/protobuf/stubs/substitute.cc",
255    "$protobuf_src_root/google/protobuf/text_format.cc",
256    "$protobuf_src_root/google/protobuf/timestamp.pb.cc",
257    "$protobuf_src_root/google/protobuf/type.pb.cc",
258    "$protobuf_src_root/google/protobuf/unknown_field_set.cc",
259    "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc",
260    "$protobuf_src_root/google/protobuf/util/field_comparator.cc",
261    "$protobuf_src_root/google/protobuf/util/field_mask_util.cc",
262    "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc",
263    "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc",
264    "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc",
265    "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc",
266    "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc",
267    "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc",
268    "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc",
269    "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc",
270    "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc",
271    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc",
272    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc",
273    "$protobuf_src_root/google/protobuf/util/internal/type_info.cc",
274    "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc",
275    "$protobuf_src_root/google/protobuf/util/internal/utility.cc",
276    "$protobuf_src_root/google/protobuf/util/json_util.cc",
277    "$protobuf_src_root/google/protobuf/util/message_differencer.cc",
278    "$protobuf_src_root/google/protobuf/util/time_util.cc",
279    "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc",
280    "$protobuf_src_root/google/protobuf/wire_format.cc",
281    "$protobuf_src_root/google/protobuf/wrappers.pb.cc",
282  ]
283  include_dirs = [
284    "$protobuf_src_root/google/protobuf/**/*.h",
285    "$protobuf_src_root/google/protobuf/**/*.inc",
286    "$protobuf_src_root",
287  ]
288  cflags_cc = [
289    "-Wno-sign-compare",
290    "-Wno-deprecated-declarations",
291  ]
292  cflags = [
293    "-Wno-sign-compare",
294    "-D HAVE_PTHREAD",
295    "-Wno-deprecated-declarations",
296  ]
297
298  deps = [ ":protobuf_lite_static" ]
299
300  public_configs = [ ":protobuf_config" ]
301  subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
302  part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
303}
304
305if (current_toolchain == host_toolchain) {
306  ohos_shared_library("protoc_lib") {
307    sources = [
308      "$protobuf_src_root/google/protobuf/compiler/code_generator.cc",
309      "$protobuf_src_root/google/protobuf/compiler/command_line_interface.cc",
310      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum.cc",
311      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum_field.cc",
312      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_extension.cc",
313      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_field.cc",
314      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_file.cc",
315      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_generator.cc",
316      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_helpers.cc",
317      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_map_field.cc",
318      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message.cc",
319      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message_field.cc",
320      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
321      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
322      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_service.cc",
323      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_string_field.cc",
324      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
325      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum.cc",
326      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum_field.cc",
327      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_field_base.cc",
328      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_generator.cc",
329      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_helpers.cc",
330      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_map_field.cc",
331      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message.cc",
332      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message_field.cc",
333      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
334      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
335      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
336      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
337      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
338      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
339      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
340      "$protobuf_src_root/google/protobuf/compiler/java/java_context.cc",
341      "$protobuf_src_root/google/protobuf/compiler/java/java_doc_comment.cc",
342      "$protobuf_src_root/google/protobuf/compiler/java/java_enum.cc",
343      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field.cc",
344      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field_lite.cc",
345      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_lite.cc",
346      "$protobuf_src_root/google/protobuf/compiler/java/java_extension.cc",
347      "$protobuf_src_root/google/protobuf/compiler/java/java_extension_lite.cc",
348      "$protobuf_src_root/google/protobuf/compiler/java/java_field.cc",
349      "$protobuf_src_root/google/protobuf/compiler/java/java_file.cc",
350      "$protobuf_src_root/google/protobuf/compiler/java/java_generator.cc",
351      "$protobuf_src_root/google/protobuf/compiler/java/java_generator_factory.cc",
352      "$protobuf_src_root/google/protobuf/compiler/java/java_helpers.cc",
353      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field.cc",
354      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field_lite.cc",
355      "$protobuf_src_root/google/protobuf/compiler/java/java_message.cc",
356      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder.cc",
357      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder_lite.cc",
358      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field.cc",
359      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field_lite.cc",
360      "$protobuf_src_root/google/protobuf/compiler/java/java_message_lite.cc",
361      "$protobuf_src_root/google/protobuf/compiler/java/java_name_resolver.cc",
362      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field.cc",
363      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field_lite.cc",
364      "$protobuf_src_root/google/protobuf/compiler/java/java_service.cc",
365      "$protobuf_src_root/google/protobuf/compiler/java/java_shared_code_generator.cc",
366      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field.cc",
367      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field_lite.cc",
368      "$protobuf_src_root/google/protobuf/compiler/js/js_generator.cc",
369      "$protobuf_src_root/google/protobuf/compiler/js/well_known_types_embed.cc",
370      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum.cc",
371      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
372      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_extension.cc",
373      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_field.cc",
374      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_file.cc",
375      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_generator.cc",
376      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
377      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
378      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message.cc",
379      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
380      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
381      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
382      "$protobuf_src_root/google/protobuf/compiler/php/php_generator.cc",
383      "$protobuf_src_root/google/protobuf/compiler/plugin.cc",
384      "$protobuf_src_root/google/protobuf/compiler/plugin.pb.cc",
385      "$protobuf_src_root/google/protobuf/compiler/python/python_generator.cc",
386      "$protobuf_src_root/google/protobuf/compiler/ruby/ruby_generator.cc",
387      "$protobuf_src_root/google/protobuf/compiler/subprocess.cc",
388      "$protobuf_src_root/google/protobuf/compiler/zip_writer.cc",
389    ]
390    include_dirs = [
391      "$protobuf_src_root/google/protobuf/**/*.h",
392      "$protobuf_src_root/google/protobuf/**/*.inc",
393      "$protobuf_src_root",
394    ]
395    cflags_cc = [
396      "-Wno-sign-compare",
397      "-Wno-unused-function",
398      "-Wno-unused-private-field",
399      "-Wno-deprecated-declarations",
400    ]
401    cflags = [
402      "-Wno-sign-compare",
403      "-D HAVE_PTHREAD",
404      "-Wno-unused-function",
405      "-Wno-deprecated-declarations",
406    ]
407
408    deps = [
409      ":protobuf",
410      ":protobuf_lite",
411    ]
412
413    public_configs = [ ":protobuf_config" ]
414    subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
415    part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
416  }
417
418  ohos_static_library("protoc_static_lib") {
419    sources = [
420      "$protobuf_src_root/google/protobuf/compiler/code_generator.cc",
421      "$protobuf_src_root/google/protobuf/compiler/command_line_interface.cc",
422      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum.cc",
423      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum_field.cc",
424      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_extension.cc",
425      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_field.cc",
426      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_file.cc",
427      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_generator.cc",
428      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_helpers.cc",
429      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_map_field.cc",
430      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message.cc",
431      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message_field.cc",
432      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
433      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
434      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_service.cc",
435      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_string_field.cc",
436      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
437      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum.cc",
438      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum_field.cc",
439      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_field_base.cc",
440      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_generator.cc",
441      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_helpers.cc",
442      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_map_field.cc",
443      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message.cc",
444      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message_field.cc",
445      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
446      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
447      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
448      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
449      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
450      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
451      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
452      "$protobuf_src_root/google/protobuf/compiler/java/java_context.cc",
453      "$protobuf_src_root/google/protobuf/compiler/java/java_doc_comment.cc",
454      "$protobuf_src_root/google/protobuf/compiler/java/java_enum.cc",
455      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field.cc",
456      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field_lite.cc",
457      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_lite.cc",
458      "$protobuf_src_root/google/protobuf/compiler/java/java_extension.cc",
459      "$protobuf_src_root/google/protobuf/compiler/java/java_extension_lite.cc",
460      "$protobuf_src_root/google/protobuf/compiler/java/java_field.cc",
461      "$protobuf_src_root/google/protobuf/compiler/java/java_file.cc",
462      "$protobuf_src_root/google/protobuf/compiler/java/java_generator.cc",
463      "$protobuf_src_root/google/protobuf/compiler/java/java_generator_factory.cc",
464      "$protobuf_src_root/google/protobuf/compiler/java/java_helpers.cc",
465      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field.cc",
466      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field_lite.cc",
467      "$protobuf_src_root/google/protobuf/compiler/java/java_message.cc",
468      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder.cc",
469      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder_lite.cc",
470      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field.cc",
471      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field_lite.cc",
472      "$protobuf_src_root/google/protobuf/compiler/java/java_message_lite.cc",
473      "$protobuf_src_root/google/protobuf/compiler/java/java_name_resolver.cc",
474      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field.cc",
475      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field_lite.cc",
476      "$protobuf_src_root/google/protobuf/compiler/java/java_service.cc",
477      "$protobuf_src_root/google/protobuf/compiler/java/java_shared_code_generator.cc",
478      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field.cc",
479      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field_lite.cc",
480      "$protobuf_src_root/google/protobuf/compiler/js/js_generator.cc",
481      "$protobuf_src_root/google/protobuf/compiler/js/well_known_types_embed.cc",
482      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum.cc",
483      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
484      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_extension.cc",
485      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_field.cc",
486      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_file.cc",
487      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_generator.cc",
488      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
489      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
490      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message.cc",
491      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
492      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
493      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
494      "$protobuf_src_root/google/protobuf/compiler/php/php_generator.cc",
495      "$protobuf_src_root/google/protobuf/compiler/plugin.cc",
496      "$protobuf_src_root/google/protobuf/compiler/plugin.pb.cc",
497      "$protobuf_src_root/google/protobuf/compiler/python/python_generator.cc",
498      "$protobuf_src_root/google/protobuf/compiler/ruby/ruby_generator.cc",
499      "$protobuf_src_root/google/protobuf/compiler/subprocess.cc",
500      "$protobuf_src_root/google/protobuf/compiler/zip_writer.cc",
501    ]
502    include_dirs = [
503      "$protobuf_src_root/google/protobuf/**/*.h",
504      "$protobuf_src_root/google/protobuf/**/*.inc",
505      "$protobuf_src_root",
506    ]
507    cflags_cc = [
508      "-Wno-sign-compare",
509      "-Wno-unused-function",
510      "-Wno-unused-private-field",
511      "-Wno-deprecated-declarations",
512    ]
513    cflags = [
514      "-Wno-sign-compare",
515      "-D HAVE_PTHREAD",
516      "-Wno-unused-function",
517      "-Wno-deprecated-declarations",
518    ]
519
520    deps = [
521      ":protobuf_lite_static",
522      ":protobuf_static",
523    ]
524
525    public_configs = [ ":protobuf_config" ]
526    subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
527    part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
528  }
529}
530
531# Only compile the plugin for the host architecture.
532if (current_toolchain == host_toolchain) {
533  ohos_executable("protoc") {
534    sources = [ "$protobuf_src_root/google/protobuf/compiler/main.cc" ]
535    include_dirs = [
536      "$protobuf_src_root/google/protobuf/**/*.h",
537      "$protobuf_src_root/google/protobuf/**/*.inc",
538      "$protobuf_src_root",
539    ]
540    deps = [ ":protoc_static_lib" ]
541    cflags_cc = [
542      "-Wno-sign-compare",
543      "-Wno-deprecated-declarations",
544    ]
545    cflags = [
546      "-Wno-sign-compare",
547      "-D HAVE_PTHREAD",
548      "-Wno-deprecated-declarations",
549    ]
550    subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}"
551    part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}"
552  }
553}
554