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