• 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
14if (defined(ark_standalone_build)) {
15  import("//developtools/profiler//build/config.gni")
16  import("$build_root/ark.gni")
17} else {
18  import("//build/ohos.gni")
19  import("//developtools/profiler/build/config.gni")
20}
21
22protobuf_src_root = "//third_party/protobuf/src/"
23
24config("protobuf_config") {
25  include_dirs = [ "$protobuf_src_root" ]
26}
27
28ohos_shared_library("protobuf_lite") {
29  sources = [
30    "$protobuf_src_root/google/protobuf/any_lite.cc",
31    "$protobuf_src_root/google/protobuf/arena.cc",
32    "$protobuf_src_root/google/protobuf/extension_set.cc",
33    "$protobuf_src_root/google/protobuf/generated_enum_util.cc",
34    "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc",
35    "$protobuf_src_root/google/protobuf/generated_message_util.cc",
36    "$protobuf_src_root/google/protobuf/implicit_weak_message.cc",
37    "$protobuf_src_root/google/protobuf/io/coded_stream.cc",
38    "$protobuf_src_root/google/protobuf/io/io_win32.cc",
39    "$protobuf_src_root/google/protobuf/io/strtod.cc",
40    "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc",
41    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc",
42    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc",
43    "$protobuf_src_root/google/protobuf/message_lite.cc",
44    "$protobuf_src_root/google/protobuf/parse_context.cc",
45    "$protobuf_src_root/google/protobuf/repeated_field.cc",
46    "$protobuf_src_root/google/protobuf/stubs/bytestream.cc",
47    "$protobuf_src_root/google/protobuf/stubs/common.cc",
48    "$protobuf_src_root/google/protobuf/stubs/int128.cc",
49    "$protobuf_src_root/google/protobuf/stubs/status.cc",
50    "$protobuf_src_root/google/protobuf/stubs/statusor.cc",
51    "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc",
52    "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc",
53    "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc",
54    "$protobuf_src_root/google/protobuf/stubs/strutil.cc",
55    "$protobuf_src_root/google/protobuf/stubs/time.cc",
56    "$protobuf_src_root/google/protobuf/wire_format_lite.cc",
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 = [ "hiviewdfx_hilog_native: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  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
80  part_name = "${OHOS_PROFILER_PART_NAME}"
81}
82
83ohos_static_library("protobuf_lite_static") {
84  sources = [
85    "$protobuf_src_root/google/protobuf/any_lite.cc",
86    "$protobuf_src_root/google/protobuf/arena.cc",
87    "$protobuf_src_root/google/protobuf/extension_set.cc",
88    "$protobuf_src_root/google/protobuf/generated_enum_util.cc",
89    "$protobuf_src_root/google/protobuf/generated_message_table_driven_lite.cc",
90    "$protobuf_src_root/google/protobuf/generated_message_util.cc",
91    "$protobuf_src_root/google/protobuf/implicit_weak_message.cc",
92    "$protobuf_src_root/google/protobuf/io/coded_stream.cc",
93    "$protobuf_src_root/google/protobuf/io/io_win32.cc",
94    "$protobuf_src_root/google/protobuf/io/strtod.cc",
95    "$protobuf_src_root/google/protobuf/io/zero_copy_stream.cc",
96    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl.cc",
97    "$protobuf_src_root/google/protobuf/io/zero_copy_stream_impl_lite.cc",
98    "$protobuf_src_root/google/protobuf/message_lite.cc",
99    "$protobuf_src_root/google/protobuf/parse_context.cc",
100    "$protobuf_src_root/google/protobuf/repeated_field.cc",
101    "$protobuf_src_root/google/protobuf/stubs/bytestream.cc",
102    "$protobuf_src_root/google/protobuf/stubs/common.cc",
103    "$protobuf_src_root/google/protobuf/stubs/int128.cc",
104    "$protobuf_src_root/google/protobuf/stubs/status.cc",
105    "$protobuf_src_root/google/protobuf/stubs/statusor.cc",
106    "$protobuf_src_root/google/protobuf/stubs/stringpiece.cc",
107    "$protobuf_src_root/google/protobuf/stubs/stringprintf.cc",
108    "$protobuf_src_root/google/protobuf/stubs/structurally_valid.cc",
109    "$protobuf_src_root/google/protobuf/stubs/strutil.cc",
110    "$protobuf_src_root/google/protobuf/stubs/time.cc",
111    "$protobuf_src_root/google/protobuf/wire_format_lite.cc",
112  ]
113  include_dirs = [
114    "$protobuf_src_root/google/protobuf/**/*.h",
115    "$protobuf_src_root/google/protobuf/**/*.inc",
116    "$protobuf_src_root",
117  ]
118  if (!is_mingw) {
119    if (default_toolchain == current_toolchain) {
120      # target build, not host build
121      defines = [ "HAVE_HILOG" ]
122      external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
123    }
124  } else {
125    defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ]
126  }
127
128  cflags_cc = [ "-Wno-sign-compare" ]
129  cflags = [
130    "-Wno-sign-compare",
131    "-D HAVE_PTHREAD",
132  ]
133  if (is_mingw) {
134    # ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:60:9: error: 'lseek' macro redefined [-Werror,-Wmacro-redefined]
135    cflags += [ "-Wno-macro-redefined" ]
136  }
137  public_configs = [ ":protobuf_config" ]
138}
139
140ohos_shared_library("protobuf") {
141  sources = [
142    "$protobuf_src_root/google/protobuf/any.cc",
143    "$protobuf_src_root/google/protobuf/any.pb.cc",
144    "$protobuf_src_root/google/protobuf/api.pb.cc",
145    "$protobuf_src_root/google/protobuf/compiler/importer.cc",
146    "$protobuf_src_root/google/protobuf/compiler/parser.cc",
147    "$protobuf_src_root/google/protobuf/descriptor.cc",
148    "$protobuf_src_root/google/protobuf/descriptor.pb.cc",
149    "$protobuf_src_root/google/protobuf/descriptor_database.cc",
150    "$protobuf_src_root/google/protobuf/duration.pb.cc",
151    "$protobuf_src_root/google/protobuf/dynamic_message.cc",
152    "$protobuf_src_root/google/protobuf/empty.pb.cc",
153    "$protobuf_src_root/google/protobuf/extension_set_heavy.cc",
154    "$protobuf_src_root/google/protobuf/field_mask.pb.cc",
155    "$protobuf_src_root/google/protobuf/generated_message_reflection.cc",
156    "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc",
157    "$protobuf_src_root/google/protobuf/io/gzip_stream.cc",
158    "$protobuf_src_root/google/protobuf/io/printer.cc",
159    "$protobuf_src_root/google/protobuf/io/tokenizer.cc",
160    "$protobuf_src_root/google/protobuf/map_field.cc",
161    "$protobuf_src_root/google/protobuf/message.cc",
162    "$protobuf_src_root/google/protobuf/reflection_ops.cc",
163    "$protobuf_src_root/google/protobuf/service.cc",
164    "$protobuf_src_root/google/protobuf/source_context.pb.cc",
165    "$protobuf_src_root/google/protobuf/struct.pb.cc",
166    "$protobuf_src_root/google/protobuf/stubs/substitute.cc",
167    "$protobuf_src_root/google/protobuf/text_format.cc",
168    "$protobuf_src_root/google/protobuf/timestamp.pb.cc",
169    "$protobuf_src_root/google/protobuf/type.pb.cc",
170    "$protobuf_src_root/google/protobuf/unknown_field_set.cc",
171    "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc",
172    "$protobuf_src_root/google/protobuf/util/field_comparator.cc",
173    "$protobuf_src_root/google/protobuf/util/field_mask_util.cc",
174    "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc",
175    "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc",
176    "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc",
177    "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc",
178    "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc",
179    "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc",
180    "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc",
181    "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc",
182    "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc",
183    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc",
184    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc",
185    "$protobuf_src_root/google/protobuf/util/internal/type_info.cc",
186    "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc",
187    "$protobuf_src_root/google/protobuf/util/internal/utility.cc",
188    "$protobuf_src_root/google/protobuf/util/json_util.cc",
189    "$protobuf_src_root/google/protobuf/util/message_differencer.cc",
190    "$protobuf_src_root/google/protobuf/util/time_util.cc",
191    "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc",
192    "$protobuf_src_root/google/protobuf/wire_format.cc",
193    "$protobuf_src_root/google/protobuf/wrappers.pb.cc",
194  ]
195  include_dirs = [
196    "$protobuf_src_root/google/protobuf/**/*.h",
197    "$protobuf_src_root/google/protobuf/**/*.inc",
198    "$protobuf_src_root",
199  ]
200  cflags_cc = [ "-Wno-sign-compare" ]
201  cflags = [
202    "-Wno-sign-compare",
203    "-D HAVE_PTHREAD",
204  ]
205
206  deps = [ ":protobuf_lite" ]
207
208  public_configs = [ ":protobuf_config" ]
209  install_enable = true
210  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
211  part_name = "${OHOS_PROFILER_PART_NAME}"
212}
213
214ohos_static_library("protobuf_static") {
215  sources = [
216    "$protobuf_src_root/google/protobuf/any.cc",
217    "$protobuf_src_root/google/protobuf/any.pb.cc",
218    "$protobuf_src_root/google/protobuf/api.pb.cc",
219    "$protobuf_src_root/google/protobuf/compiler/importer.cc",
220    "$protobuf_src_root/google/protobuf/compiler/parser.cc",
221    "$protobuf_src_root/google/protobuf/descriptor.cc",
222    "$protobuf_src_root/google/protobuf/descriptor.pb.cc",
223    "$protobuf_src_root/google/protobuf/descriptor_database.cc",
224    "$protobuf_src_root/google/protobuf/duration.pb.cc",
225    "$protobuf_src_root/google/protobuf/dynamic_message.cc",
226    "$protobuf_src_root/google/protobuf/empty.pb.cc",
227    "$protobuf_src_root/google/protobuf/extension_set_heavy.cc",
228    "$protobuf_src_root/google/protobuf/field_mask.pb.cc",
229    "$protobuf_src_root/google/protobuf/generated_message_reflection.cc",
230    "$protobuf_src_root/google/protobuf/generated_message_table_driven.cc",
231    "$protobuf_src_root/google/protobuf/io/gzip_stream.cc",
232    "$protobuf_src_root/google/protobuf/io/printer.cc",
233    "$protobuf_src_root/google/protobuf/io/tokenizer.cc",
234    "$protobuf_src_root/google/protobuf/map_field.cc",
235    "$protobuf_src_root/google/protobuf/message.cc",
236    "$protobuf_src_root/google/protobuf/reflection_ops.cc",
237    "$protobuf_src_root/google/protobuf/service.cc",
238    "$protobuf_src_root/google/protobuf/source_context.pb.cc",
239    "$protobuf_src_root/google/protobuf/struct.pb.cc",
240    "$protobuf_src_root/google/protobuf/stubs/substitute.cc",
241    "$protobuf_src_root/google/protobuf/text_format.cc",
242    "$protobuf_src_root/google/protobuf/timestamp.pb.cc",
243    "$protobuf_src_root/google/protobuf/type.pb.cc",
244    "$protobuf_src_root/google/protobuf/unknown_field_set.cc",
245    "$protobuf_src_root/google/protobuf/util/delimited_message_util.cc",
246    "$protobuf_src_root/google/protobuf/util/field_comparator.cc",
247    "$protobuf_src_root/google/protobuf/util/field_mask_util.cc",
248    "$protobuf_src_root/google/protobuf/util/internal/datapiece.cc",
249    "$protobuf_src_root/google/protobuf/util/internal/default_value_objectwriter.cc",
250    "$protobuf_src_root/google/protobuf/util/internal/error_listener.cc",
251    "$protobuf_src_root/google/protobuf/util/internal/field_mask_utility.cc",
252    "$protobuf_src_root/google/protobuf/util/internal/json_escaping.cc",
253    "$protobuf_src_root/google/protobuf/util/internal/json_objectwriter.cc",
254    "$protobuf_src_root/google/protobuf/util/internal/json_stream_parser.cc",
255    "$protobuf_src_root/google/protobuf/util/internal/object_writer.cc",
256    "$protobuf_src_root/google/protobuf/util/internal/proto_writer.cc",
257    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectsource.cc",
258    "$protobuf_src_root/google/protobuf/util/internal/protostream_objectwriter.cc",
259    "$protobuf_src_root/google/protobuf/util/internal/type_info.cc",
260    "$protobuf_src_root/google/protobuf/util/internal/type_info_test_helper.cc",
261    "$protobuf_src_root/google/protobuf/util/internal/utility.cc",
262    "$protobuf_src_root/google/protobuf/util/json_util.cc",
263    "$protobuf_src_root/google/protobuf/util/message_differencer.cc",
264    "$protobuf_src_root/google/protobuf/util/time_util.cc",
265    "$protobuf_src_root/google/protobuf/util/type_resolver_util.cc",
266    "$protobuf_src_root/google/protobuf/wire_format.cc",
267    "$protobuf_src_root/google/protobuf/wrappers.pb.cc",
268  ]
269  include_dirs = [
270    "$protobuf_src_root/google/protobuf/**/*.h",
271    "$protobuf_src_root/google/protobuf/**/*.inc",
272    "$protobuf_src_root",
273  ]
274  cflags_cc = [ "-Wno-sign-compare" ]
275  cflags = [
276    "-Wno-sign-compare",
277    "-D HAVE_PTHREAD",
278  ]
279
280  deps = [ ":protobuf_lite_static" ]
281
282  public_configs = [ ":protobuf_config" ]
283}
284
285if (current_toolchain == host_toolchain) {
286  ohos_shared_library("protoc_lib") {
287    sources = [
288      "$protobuf_src_root/google/protobuf/compiler/code_generator.cc",
289      "$protobuf_src_root/google/protobuf/compiler/command_line_interface.cc",
290      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum.cc",
291      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_enum_field.cc",
292      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_extension.cc",
293      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_field.cc",
294      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_file.cc",
295      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_generator.cc",
296      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_helpers.cc",
297      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_map_field.cc",
298      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message.cc",
299      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_message_field.cc",
300      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
301      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
302      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_service.cc",
303      "$protobuf_src_root/google/protobuf/compiler/cpp/cpp_string_field.cc",
304      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_doc_comment.cc",
305      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum.cc",
306      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_enum_field.cc",
307      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_field_base.cc",
308      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_generator.cc",
309      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_helpers.cc",
310      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_map_field.cc",
311      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message.cc",
312      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_message_field.cc",
313      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_primitive_field.cc",
314      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_reflection_class.cc",
315      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc",
316      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc",
317      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
318      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
319      "$protobuf_src_root/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
320      "$protobuf_src_root/google/protobuf/compiler/java/java_context.cc",
321      "$protobuf_src_root/google/protobuf/compiler/java/java_doc_comment.cc",
322      "$protobuf_src_root/google/protobuf/compiler/java/java_enum.cc",
323      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field.cc",
324      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_field_lite.cc",
325      "$protobuf_src_root/google/protobuf/compiler/java/java_enum_lite.cc",
326      "$protobuf_src_root/google/protobuf/compiler/java/java_extension.cc",
327      "$protobuf_src_root/google/protobuf/compiler/java/java_extension_lite.cc",
328      "$protobuf_src_root/google/protobuf/compiler/java/java_field.cc",
329      "$protobuf_src_root/google/protobuf/compiler/java/java_file.cc",
330      "$protobuf_src_root/google/protobuf/compiler/java/java_generator.cc",
331      "$protobuf_src_root/google/protobuf/compiler/java/java_generator_factory.cc",
332      "$protobuf_src_root/google/protobuf/compiler/java/java_helpers.cc",
333      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field.cc",
334      "$protobuf_src_root/google/protobuf/compiler/java/java_map_field_lite.cc",
335      "$protobuf_src_root/google/protobuf/compiler/java/java_message.cc",
336      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder.cc",
337      "$protobuf_src_root/google/protobuf/compiler/java/java_message_builder_lite.cc",
338      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field.cc",
339      "$protobuf_src_root/google/protobuf/compiler/java/java_message_field_lite.cc",
340      "$protobuf_src_root/google/protobuf/compiler/java/java_message_lite.cc",
341      "$protobuf_src_root/google/protobuf/compiler/java/java_name_resolver.cc",
342      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field.cc",
343      "$protobuf_src_root/google/protobuf/compiler/java/java_primitive_field_lite.cc",
344      "$protobuf_src_root/google/protobuf/compiler/java/java_service.cc",
345      "$protobuf_src_root/google/protobuf/compiler/java/java_shared_code_generator.cc",
346      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field.cc",
347      "$protobuf_src_root/google/protobuf/compiler/java/java_string_field_lite.cc",
348      "$protobuf_src_root/google/protobuf/compiler/js/js_generator.cc",
349      "$protobuf_src_root/google/protobuf/compiler/js/well_known_types_embed.cc",
350      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum.cc",
351      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
352      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_extension.cc",
353      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_field.cc",
354      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_file.cc",
355      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_generator.cc",
356      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_helpers.cc",
357      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_map_field.cc",
358      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message.cc",
359      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
360      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
361      "$protobuf_src_root/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
362      "$protobuf_src_root/google/protobuf/compiler/php/php_generator.cc",
363      "$protobuf_src_root/google/protobuf/compiler/plugin.cc",
364      "$protobuf_src_root/google/protobuf/compiler/plugin.pb.cc",
365      "$protobuf_src_root/google/protobuf/compiler/python/python_generator.cc",
366      "$protobuf_src_root/google/protobuf/compiler/ruby/ruby_generator.cc",
367      "$protobuf_src_root/google/protobuf/compiler/subprocess.cc",
368      "$protobuf_src_root/google/protobuf/compiler/zip_writer.cc",
369    ]
370    include_dirs = [
371      "$protobuf_src_root/google/protobuf/**/*.h",
372      "$protobuf_src_root/google/protobuf/**/*.inc",
373      "$protobuf_src_root",
374    ]
375    cflags_cc = [
376      "-Wno-sign-compare",
377      "-Wno-unused-function",
378      "-Wno-unused-private-field",
379    ]
380    cflags = [
381      "-Wno-sign-compare",
382      "-D HAVE_PTHREAD",
383      "-Wno-unused-function",
384    ]
385
386    deps = [
387      ":protobuf",
388      ":protobuf_lite",
389    ]
390
391    public_configs = [ ":protobuf_config" ]
392    subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
393    part_name = "${OHOS_PROFILER_PART_NAME}"
394  }
395}
396
397# Only compile the plugin for the host architecture.
398if (current_toolchain == host_toolchain) {
399  ohos_executable("protoc") {
400    sources = [ "$protobuf_src_root/google/protobuf/compiler/main.cc" ]
401    include_dirs = [
402      "$protobuf_src_root/google/protobuf/**/*.h",
403      "$protobuf_src_root/google/protobuf/**/*.inc",
404      "$protobuf_src_root",
405    ]
406    deps = [ ":protoc_lib" ]
407    cflags_cc = [ "-Wno-sign-compare" ]
408    cflags = [
409      "-Wno-sign-compare",
410      "-D HAVE_PTHREAD",
411    ]
412
413    subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
414    part_name = "${OHOS_PROFILER_PART_NAME}"
415  }
416}
417