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 = [ 21 "src", 22 "third_party/abseil-cpp", 23 "third_party/utf8_range", 24 ] 25 cflags = [ "-Wno-gcc-compat" ] 26} 27 28ohos_shared_library("protobuf_lite") { 29 branch_protector_ret = "pac_ret" 30 sources = [ 31 "src/google/protobuf/any_lite.cc", 32 "src/google/protobuf/arena.cc", 33 "src/google/protobuf/arena_align.cc", 34 "src/google/protobuf/arenastring.cc", 35 "src/google/protobuf/arenaz_sampler.cc", 36 "src/google/protobuf/extension_set.cc", 37 "src/google/protobuf/generated_enum_util.cc", 38 "src/google/protobuf/generated_message_tctable_lite.cc", 39 "src/google/protobuf/generated_message_util.cc", 40 "src/google/protobuf/implicit_weak_message.cc", 41 "src/google/protobuf/inlined_string_field.cc", 42 "src/google/protobuf/io/coded_stream.cc", 43 "src/google/protobuf/io/io_win32.cc", 44 "src/google/protobuf/io/zero_copy_stream.cc", 45 "src/google/protobuf/io/zero_copy_stream_impl.cc", 46 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 47 "src/google/protobuf/map.cc", 48 "src/google/protobuf/message_lite.cc", 49 "src/google/protobuf/parse_context.cc", 50 "src/google/protobuf/port.cc", 51 "src/google/protobuf/raw_ptr.cc", 52 "src/google/protobuf/repeated_field.cc", 53 "src/google/protobuf/repeated_ptr_field.cc", 54 "src/google/protobuf/stubs/common.cc", 55 "src/google/protobuf/wire_format_lite.cc", 56 "third_party/utf8_range/utf8_range.c", 57 "third_party/utf8_range/utf8_validity.cc", 58 ] 59 60 include_dirs = [ 61 "src/google/protobuf/**/*.h", 62 "src/google/protobuf/**/*.inc", 63 "src", 64 "third_party/utf8_range", 65 ] 66 if (!is_mingw) { 67 external_deps = [ "abseil-cpp:absl_base_static" ] 68 } else { 69 defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] 70 } 71 72 cflags_cc = [ "-Wno-sign-compare" ] 73 cflags = [ 74 "-Wno-sign-compare", 75 "-D HAVE_PTHREAD", 76 ] 77 78 public_configs = [ ":protobuf_config" ] 79 install_enable = true 80 innerapi_tags = [ 81 "platformsdk_indirect", 82 "chipsetsdk_sp", 83 ] 84 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 85 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 86} 87 88ohos_static_library("protobuf_lite_static") { 89 sources = [ 90 "src/google/protobuf/any.cc", 91 "src/google/protobuf/any_lite.cc", 92 "src/google/protobuf/arena.cc", 93 "src/google/protobuf/arena_align.cc", 94 "src/google/protobuf/arenastring.cc", 95 "src/google/protobuf/arenaz_sampler.cc", 96 "src/google/protobuf/cpp_features.pb.cc", 97 "src/google/protobuf/descriptor.cc", 98 "src/google/protobuf/descriptor.pb.cc", 99 "src/google/protobuf/descriptor_database.cc", 100 "src/google/protobuf/dynamic_message.cc", 101 "src/google/protobuf/extension_set.cc", 102 "src/google/protobuf/extension_set_heavy.cc", 103 "src/google/protobuf/feature_resolver.cc", 104 "src/google/protobuf/generated_enum_util.cc", 105 "src/google/protobuf/generated_message_reflection.cc", 106 "src/google/protobuf/generated_message_tctable_full.cc", 107 "src/google/protobuf/generated_message_tctable_gen.cc", 108 "src/google/protobuf/generated_message_tctable_lite.cc", 109 "src/google/protobuf/generated_message_util.cc", 110 "src/google/protobuf/implicit_weak_message.cc", 111 "src/google/protobuf/inlined_string_field.cc", 112 "src/google/protobuf/io/coded_stream.cc", 113 "src/google/protobuf/io/io_win32.cc", 114 "src/google/protobuf/io/strtod.cc", 115 "src/google/protobuf/io/tokenizer.cc", 116 "src/google/protobuf/io/zero_copy_stream.cc", 117 "src/google/protobuf/io/zero_copy_stream_impl.cc", 118 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 119 "src/google/protobuf/map.cc", 120 "src/google/protobuf/map_field.cc", 121 "src/google/protobuf/message.cc", 122 "src/google/protobuf/message_lite.cc", 123 "src/google/protobuf/parse_context.cc", 124 "src/google/protobuf/port.cc", 125 "src/google/protobuf/raw_ptr.cc", 126 "src/google/protobuf/reflection_mode.cc", 127 "src/google/protobuf/reflection_ops.cc", 128 "src/google/protobuf/repeated_field.cc", 129 "src/google/protobuf/repeated_ptr_field.cc", 130 "src/google/protobuf/stubs/common.cc", 131 "src/google/protobuf/text_format.cc", 132 "src/google/protobuf/unknown_field_set.cc", 133 "src/google/protobuf/wire_format.cc", 134 "src/google/protobuf/wire_format_lite.cc", 135 "third_party/utf8_range/utf8_range.c", 136 "third_party/utf8_range/utf8_validity.cc", 137 ] 138 include_dirs = [ 139 "src/google/protobuf/**/*.h", 140 "src/google/protobuf/**/*.inc", 141 "src", 142 "third_party/utf8_range", 143 ] 144 if (!is_mingw) { 145 # target build, not host build 146 defines = [ "HAVE_HILOG" ] 147 } else { 148 defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] 149 } 150 if (is_arkui_x) { 151 deps = [ "//third_party/abseil-cpp:absl_base_static" ] 152 } else { 153 external_deps = [ "abseil-cpp:absl_base_static" ] 154 } 155 cflags_cc = [ 156 "-Wno-sign-compare", 157 "-Wno-deprecated-declarations", 158 ] 159 cflags = [ 160 "-Wno-deprecated-declarations", 161 "-Wno-sign-compare", 162 "-Wno-gcc-compat", 163 "-D HAVE_PTHREAD", 164 ] 165 if (is_mingw) { 166 # ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:60:9: error: 'lseek' macro redefined [-Werror,-Wmacro-redefined] 167 cflags += [ "-Wno-macro-redefined" ] 168 } 169 public_configs = [ ":protobuf_config" ] 170 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 171 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 172} 173 174ohos_shared_library("protobuf") { 175 sources = [ 176 "src/google/protobuf/any.cc", 177 "src/google/protobuf/any.pb.cc", 178 "src/google/protobuf/any_lite.cc", 179 "src/google/protobuf/api.pb.cc", 180 "src/google/protobuf/arena.cc", 181 "src/google/protobuf/arena_align.cc", 182 "src/google/protobuf/arenastring.cc", 183 "src/google/protobuf/arenaz_sampler.cc", 184 "src/google/protobuf/compiler/importer.cc", 185 "src/google/protobuf/compiler/parser.cc", 186 "src/google/protobuf/cpp_features.pb.cc", 187 "src/google/protobuf/descriptor.cc", 188 "src/google/protobuf/descriptor.pb.cc", 189 "src/google/protobuf/descriptor_database.cc", 190 "src/google/protobuf/duration.pb.cc", 191 "src/google/protobuf/dynamic_message.cc", 192 "src/google/protobuf/empty.pb.cc", 193 "src/google/protobuf/extension_set.cc", 194 "src/google/protobuf/extension_set_heavy.cc", 195 "src/google/protobuf/feature_resolver.cc", 196 "src/google/protobuf/field_mask.pb.cc", 197 "src/google/protobuf/generated_enum_util.cc", 198 "src/google/protobuf/generated_message_bases.cc", 199 "src/google/protobuf/generated_message_reflection.cc", 200 "src/google/protobuf/generated_message_tctable_full.cc", 201 "src/google/protobuf/generated_message_tctable_gen.cc", 202 "src/google/protobuf/generated_message_tctable_lite.cc", 203 "src/google/protobuf/generated_message_util.cc", 204 "src/google/protobuf/implicit_weak_message.cc", 205 "src/google/protobuf/inlined_string_field.cc", 206 "src/google/protobuf/io/coded_stream.cc", 207 "src/google/protobuf/io/gzip_stream.cc", 208 "src/google/protobuf/io/io_win32.cc", 209 "src/google/protobuf/io/printer.cc", 210 "src/google/protobuf/io/strtod.cc", 211 "src/google/protobuf/io/tokenizer.cc", 212 "src/google/protobuf/io/zero_copy_sink.cc", 213 "src/google/protobuf/io/zero_copy_stream.cc", 214 "src/google/protobuf/io/zero_copy_stream_impl.cc", 215 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 216 "src/google/protobuf/json/internal/lexer.cc", 217 "src/google/protobuf/json/internal/message_path.cc", 218 "src/google/protobuf/json/internal/parser.cc", 219 "src/google/protobuf/json/internal/unparser.cc", 220 "src/google/protobuf/json/internal/untyped_message.cc", 221 "src/google/protobuf/json/internal/writer.cc", 222 "src/google/protobuf/json/internal/zero_copy_buffered_stream.cc", 223 "src/google/protobuf/json/json.cc", 224 "src/google/protobuf/map.cc", 225 "src/google/protobuf/map_field.cc", 226 "src/google/protobuf/message.cc", 227 "src/google/protobuf/message_lite.cc", 228 "src/google/protobuf/parse_context.cc", 229 "src/google/protobuf/port.cc", 230 "src/google/protobuf/raw_ptr.cc", 231 "src/google/protobuf/reflection_mode.cc", 232 "src/google/protobuf/reflection_ops.cc", 233 "src/google/protobuf/repeated_field.cc", 234 "src/google/protobuf/repeated_ptr_field.cc", 235 "src/google/protobuf/service.cc", 236 "src/google/protobuf/source_context.pb.cc", 237 "src/google/protobuf/struct.pb.cc", 238 "src/google/protobuf/stubs/common.cc", 239 "src/google/protobuf/text_format.cc", 240 "src/google/protobuf/timestamp.pb.cc", 241 "src/google/protobuf/type.pb.cc", 242 "src/google/protobuf/unknown_field_set.cc", 243 "src/google/protobuf/util/delimited_message_util.cc", 244 "src/google/protobuf/util/field_comparator.cc", 245 "src/google/protobuf/util/field_mask_util.cc", 246 "src/google/protobuf/util/message_differencer.cc", 247 "src/google/protobuf/util/time_util.cc", 248 "src/google/protobuf/util/type_resolver_util.cc", 249 "src/google/protobuf/wire_format.cc", 250 "src/google/protobuf/wire_format_lite.cc", 251 "src/google/protobuf/wrappers.pb.cc", 252 "third_party/utf8_range/utf8_validity.cc", 253 "third_party/utf8_range/utf8_range.c", 254 ] 255 include_dirs = [ 256 "src/google/protobuf/**/*.h", 257 "src/google/protobuf/**/*.inc", 258 "src", 259 "third_party/utf8_range", 260 ] 261 cflags_cc = [ 262 "-Wno-sign-compare", 263 "-Wno-deprecated-declarations", 264 ] 265 cflags = [ 266 "-Wno-sign-compare", 267 "-D HAVE_PTHREAD", 268 "-Wno-deprecated-declarations", 269 ] 270 external_deps = [ "abseil-cpp:absl_base_static" ] 271 public_configs = [ ":protobuf_config" ] 272 install_enable = true 273 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 274 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 275} 276 277ohos_static_library("protobuf_static") { 278 sources = [ 279 "src/google/protobuf/any.cc", 280 "src/google/protobuf/any.pb.cc", 281 "src/google/protobuf/any_lite.cc", 282 "src/google/protobuf/api.pb.cc", 283 "src/google/protobuf/arena.cc", 284 "src/google/protobuf/arena_align.cc", 285 "src/google/protobuf/arenastring.cc", 286 "src/google/protobuf/arenaz_sampler.cc", 287 "src/google/protobuf/compiler/importer.cc", 288 "src/google/protobuf/compiler/parser.cc", 289 "src/google/protobuf/cpp_features.pb.cc", 290 "src/google/protobuf/descriptor.cc", 291 "src/google/protobuf/descriptor.pb.cc", 292 "src/google/protobuf/descriptor_database.cc", 293 "src/google/protobuf/duration.pb.cc", 294 "src/google/protobuf/dynamic_message.cc", 295 "src/google/protobuf/empty.pb.cc", 296 "src/google/protobuf/extension_set.cc", 297 "src/google/protobuf/extension_set_heavy.cc", 298 "src/google/protobuf/feature_resolver.cc", 299 "src/google/protobuf/field_mask.pb.cc", 300 "src/google/protobuf/generated_enum_util.cc", 301 "src/google/protobuf/generated_message_bases.cc", 302 "src/google/protobuf/generated_message_reflection.cc", 303 "src/google/protobuf/generated_message_tctable_full.cc", 304 "src/google/protobuf/generated_message_tctable_gen.cc", 305 "src/google/protobuf/generated_message_tctable_lite.cc", 306 "src/google/protobuf/generated_message_util.cc", 307 "src/google/protobuf/implicit_weak_message.cc", 308 "src/google/protobuf/inlined_string_field.cc", 309 "src/google/protobuf/io/coded_stream.cc", 310 "src/google/protobuf/io/gzip_stream.cc", 311 "src/google/protobuf/io/io_win32.cc", 312 "src/google/protobuf/io/printer.cc", 313 "src/google/protobuf/io/strtod.cc", 314 "src/google/protobuf/io/tokenizer.cc", 315 "src/google/protobuf/io/zero_copy_sink.cc", 316 "src/google/protobuf/io/zero_copy_stream.cc", 317 "src/google/protobuf/io/zero_copy_stream_impl.cc", 318 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 319 "src/google/protobuf/json/internal/lexer.cc", 320 "src/google/protobuf/json/internal/message_path.cc", 321 "src/google/protobuf/json/internal/parser.cc", 322 "src/google/protobuf/json/internal/unparser.cc", 323 "src/google/protobuf/json/internal/untyped_message.cc", 324 "src/google/protobuf/json/internal/writer.cc", 325 "src/google/protobuf/json/internal/zero_copy_buffered_stream.cc", 326 "src/google/protobuf/json/json.cc", 327 "src/google/protobuf/map.cc", 328 "src/google/protobuf/map_field.cc", 329 "src/google/protobuf/message.cc", 330 "src/google/protobuf/message_lite.cc", 331 "src/google/protobuf/parse_context.cc", 332 "src/google/protobuf/port.cc", 333 "src/google/protobuf/raw_ptr.cc", 334 "src/google/protobuf/reflection_mode.cc", 335 "src/google/protobuf/reflection_ops.cc", 336 "src/google/protobuf/repeated_field.cc", 337 "src/google/protobuf/repeated_ptr_field.cc", 338 "src/google/protobuf/service.cc", 339 "src/google/protobuf/source_context.pb.cc", 340 "src/google/protobuf/struct.pb.cc", 341 "src/google/protobuf/stubs/common.cc", 342 "src/google/protobuf/text_format.cc", 343 "src/google/protobuf/timestamp.pb.cc", 344 "src/google/protobuf/type.pb.cc", 345 "src/google/protobuf/unknown_field_set.cc", 346 "src/google/protobuf/util/delimited_message_util.cc", 347 "src/google/protobuf/util/field_comparator.cc", 348 "src/google/protobuf/util/field_mask_util.cc", 349 "src/google/protobuf/util/message_differencer.cc", 350 "src/google/protobuf/util/time_util.cc", 351 "src/google/protobuf/util/type_resolver_util.cc", 352 "src/google/protobuf/wire_format.cc", 353 "src/google/protobuf/wire_format_lite.cc", 354 "src/google/protobuf/wrappers.pb.cc", 355 "third_party/utf8_range/utf8_validity.cc", 356 ] 357 include_dirs = [ 358 "src/google/protobuf/**/*.h", 359 "src/google/protobuf/**/*.inc", 360 "src", 361 "third_party/utf8_range", 362 ] 363 cflags_cc = [ 364 "-Wno-sign-compare", 365 "-Wno-deprecated-declarations", 366 ] 367 cflags = [ 368 "-Wno-sign-compare", 369 "-D HAVE_PTHREAD", 370 "-Wno-deprecated-declarations", 371 "-Wno-gcc-compat", 372 ] 373 374 deps = [ ":protobuf_lite_static" ] 375 if (is_arkui_x) { 376 deps += [ "//third_party/abseil-cpp:absl_base_static" ] 377 } else { 378 external_deps = [ "abseil-cpp:absl_base_static" ] 379 } 380 381 if (is_mingw) { 382 # ../../third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl.cc:60:9: error: 'lseek' macro redefined [-Werror,-Wmacro-redefined] 383 cflags += [ "-Wno-macro-redefined" ] 384 } 385 386 public_configs = [ ":protobuf_config" ] 387 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 388 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 389} 390 391ohos_shared_library("protoc_lib") { 392 sources = [ 393 "src/google/protobuf/compiler/code_generator.cc", 394 "src/google/protobuf/compiler/code_generator_lite.cc", 395 "src/google/protobuf/compiler/command_line_interface.cc", 396 "src/google/protobuf/compiler/cpp/enum.cc", 397 "src/google/protobuf/compiler/cpp/extension.cc", 398 "src/google/protobuf/compiler/cpp/field.cc", 399 "src/google/protobuf/compiler/cpp/field_generators/cord_field.cc", 400 "src/google/protobuf/compiler/cpp/field_generators/enum_field.cc", 401 "src/google/protobuf/compiler/cpp/field_generators/map_field.cc", 402 "src/google/protobuf/compiler/cpp/field_generators/message_field.cc", 403 "src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc", 404 "src/google/protobuf/compiler/cpp/field_generators/string_field.cc", 405 "src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc", 406 "src/google/protobuf/compiler/cpp/file.cc", 407 "src/google/protobuf/compiler/cpp/generator.cc", 408 "src/google/protobuf/compiler/cpp/helpers.cc", 409 "src/google/protobuf/compiler/cpp/ifndef_guard.cc", 410 "src/google/protobuf/compiler/cpp/message.cc", 411 "src/google/protobuf/compiler/cpp/namespace_printer.cc", 412 "src/google/protobuf/compiler/cpp/padding_optimizer.cc", 413 "src/google/protobuf/compiler/cpp/parse_function_generator.cc", 414 "src/google/protobuf/compiler/cpp/service.cc", 415 "src/google/protobuf/compiler/cpp/tracker.cc", 416 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", 417 "src/google/protobuf/compiler/csharp/csharp_enum.cc", 418 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", 419 "src/google/protobuf/compiler/csharp/csharp_field_base.cc", 420 "src/google/protobuf/compiler/csharp/csharp_generator.cc", 421 "src/google/protobuf/compiler/csharp/csharp_helpers.cc", 422 "src/google/protobuf/compiler/csharp/csharp_map_field.cc", 423 "src/google/protobuf/compiler/csharp/csharp_message.cc", 424 "src/google/protobuf/compiler/csharp/csharp_message_field.cc", 425 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", 426 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", 427 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", 428 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", 429 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", 430 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", 431 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", 432 "src/google/protobuf/compiler/csharp/names.cc", 433 "src/google/protobuf/compiler/java/context.cc", 434 "src/google/protobuf/compiler/java/doc_comment.cc", 435 "src/google/protobuf/compiler/java/field_common.cc", 436 "src/google/protobuf/compiler/java/file.cc", 437 "src/google/protobuf/compiler/java/full/enum.cc", 438 "src/google/protobuf/compiler/java/full/enum_field.cc", 439 "src/google/protobuf/compiler/java/full/extension.cc", 440 "src/google/protobuf/compiler/java/full/generator_factory.cc", 441 "src/google/protobuf/compiler/java/full/make_field_gens.cc", 442 "src/google/protobuf/compiler/java/full/map_field.cc", 443 "src/google/protobuf/compiler/java/full/message.cc", 444 "src/google/protobuf/compiler/java/full/message_builder.cc", 445 "src/google/protobuf/compiler/java/full/message_field.cc", 446 "src/google/protobuf/compiler/java/full/primitive_field.cc", 447 "src/google/protobuf/compiler/java/full/service.cc", 448 "src/google/protobuf/compiler/java/full/string_field.cc", 449 "src/google/protobuf/compiler/java/generator.cc", 450 "src/google/protobuf/compiler/java/helpers.cc", 451 "src/google/protobuf/compiler/java/internal_helpers.cc", 452 "src/google/protobuf/compiler/java/java_features.pb.cc", 453 "src/google/protobuf/compiler/java/lite/enum.cc", 454 "src/google/protobuf/compiler/java/lite/enum_field.cc", 455 "src/google/protobuf/compiler/java/lite/extension.cc", 456 "src/google/protobuf/compiler/java/lite/generator_factory.cc", 457 "src/google/protobuf/compiler/java/lite/make_field_gens.cc", 458 "src/google/protobuf/compiler/java/lite/map_field.cc", 459 "src/google/protobuf/compiler/java/lite/message.cc", 460 "src/google/protobuf/compiler/java/lite/message_builder.cc", 461 "src/google/protobuf/compiler/java/lite/message_field.cc", 462 "src/google/protobuf/compiler/java/lite/primitive_field.cc", 463 "src/google/protobuf/compiler/java/lite/string_field.cc", 464 "src/google/protobuf/compiler/java/message_serialization.cc", 465 "src/google/protobuf/compiler/java/name_resolver.cc", 466 "src/google/protobuf/compiler/java/names.cc", 467 "src/google/protobuf/compiler/java/shared_code_generator.cc", 468 "src/google/protobuf/compiler/kotlin/file.cc", 469 "src/google/protobuf/compiler/kotlin/generator.cc", 470 "src/google/protobuf/compiler/kotlin/message.cc", 471 "src/google/protobuf/compiler/objectivec/enum.cc", 472 "src/google/protobuf/compiler/objectivec/enum_field.cc", 473 "src/google/protobuf/compiler/objectivec/extension.cc", 474 "src/google/protobuf/compiler/objectivec/field.cc", 475 "src/google/protobuf/compiler/objectivec/file.cc", 476 "src/google/protobuf/compiler/objectivec/generator.cc", 477 "src/google/protobuf/compiler/objectivec/helpers.cc", 478 "src/google/protobuf/compiler/objectivec/import_writer.cc", 479 "src/google/protobuf/compiler/objectivec/line_consumer.cc", 480 "src/google/protobuf/compiler/objectivec/map_field.cc", 481 "src/google/protobuf/compiler/objectivec/message.cc", 482 "src/google/protobuf/compiler/objectivec/message_field.cc", 483 "src/google/protobuf/compiler/objectivec/names.cc", 484 "src/google/protobuf/compiler/objectivec/oneof.cc", 485 "src/google/protobuf/compiler/objectivec/primitive_field.cc", 486 "src/google/protobuf/compiler/objectivec/tf_decode_data.cc", 487 "src/google/protobuf/compiler/php/names.cc", 488 "src/google/protobuf/compiler/php/php_generator.cc", 489 "src/google/protobuf/compiler/plugin.cc", 490 "src/google/protobuf/compiler/plugin.pb.cc", 491 "src/google/protobuf/compiler/python/generator.cc", 492 "src/google/protobuf/compiler/python/helpers.cc", 493 "src/google/protobuf/compiler/python/pyi_generator.cc", 494 "src/google/protobuf/compiler/retention.cc", 495 "src/google/protobuf/compiler/ruby/ruby_generator.cc", 496 "src/google/protobuf/compiler/rust/accessors/accessor_case.cc", 497 "src/google/protobuf/compiler/rust/accessors/accessors.cc", 498 "src/google/protobuf/compiler/rust/accessors/default_value.cc", 499 "src/google/protobuf/compiler/rust/accessors/map.cc", 500 "src/google/protobuf/compiler/rust/accessors/repeated_field.cc", 501 "src/google/protobuf/compiler/rust/accessors/singular_cord.cc", 502 "src/google/protobuf/compiler/rust/accessors/singular_message.cc", 503 "src/google/protobuf/compiler/rust/accessors/singular_scalar.cc", 504 "src/google/protobuf/compiler/rust/accessors/singular_string.cc", 505 "src/google/protobuf/compiler/rust/accessors/unsupported_field.cc", 506 "src/google/protobuf/compiler/rust/accessors/with_presence.cc", 507 "src/google/protobuf/compiler/rust/context.cc", 508 "src/google/protobuf/compiler/rust/crate_mapping.cc", 509 "src/google/protobuf/compiler/rust/enum.cc", 510 "src/google/protobuf/compiler/rust/generator.cc", 511 "src/google/protobuf/compiler/rust/message.cc", 512 "src/google/protobuf/compiler/rust/naming.cc", 513 "src/google/protobuf/compiler/rust/oneof.cc", 514 "src/google/protobuf/compiler/rust/relative_path.cc", 515 "src/google/protobuf/compiler/rust/rust_field_type.cc", 516 "src/google/protobuf/compiler/rust/rust_keywords.cc", 517 "src/google/protobuf/compiler/rust/upb_helpers.cc", 518 "src/google/protobuf/compiler/subprocess.cc", 519 "src/google/protobuf/compiler/versions.cc", 520 "src/google/protobuf/compiler/zip_writer.cc", 521 "src/google/protobuf/testing/file.cc", 522 "third_party/utf8_range/utf8_validity.cc", 523 "upb_generator/common/names.cc", 524 "upb_generator/minitable/names.cc", 525 "upb_generator/minitable/names_internal.cc", 526 ] 527 include_dirs = [ 528 "src/google/protobuf/**/*.h", 529 "src/google/protobuf/**/*.inc", 530 "src", 531 "third_party/utf8_range", 532 "//third_party/protobuf", 533 ] 534 cflags_cc = [ 535 "-Wno-sign-compare", 536 "-Wno-unused-function", 537 "-Wno-unused-private-field", 538 "-Wno-deprecated-declarations", 539 ] 540 cflags = [ 541 "-Wno-sign-compare", 542 "-D HAVE_PTHREAD", 543 "-Wno-unused-function", 544 "-Wno-deprecated-declarations", 545 ] 546 547 deps = [ 548 ":protobuf", 549 ":protobuf_lite", 550 ] 551 external_deps = [ "abseil-cpp:absl_base_static" ] 552 install_enable = false 553 public_configs = [ ":protobuf_config" ] 554 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 555 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 556} 557 558ohos_static_library("protoc_static_lib") { 559 sources = [ 560 "src/google/protobuf/compiler/code_generator.cc", 561 "src/google/protobuf/compiler/code_generator_lite.cc", 562 "src/google/protobuf/compiler/command_line_interface.cc", 563 "src/google/protobuf/compiler/cpp/enum.cc", 564 "src/google/protobuf/compiler/cpp/extension.cc", 565 "src/google/protobuf/compiler/cpp/field.cc", 566 "src/google/protobuf/compiler/cpp/field_generators/cord_field.cc", 567 "src/google/protobuf/compiler/cpp/field_generators/enum_field.cc", 568 "src/google/protobuf/compiler/cpp/field_generators/map_field.cc", 569 "src/google/protobuf/compiler/cpp/field_generators/message_field.cc", 570 "src/google/protobuf/compiler/cpp/field_generators/primitive_field.cc", 571 "src/google/protobuf/compiler/cpp/field_generators/string_field.cc", 572 "src/google/protobuf/compiler/cpp/field_generators/string_view_field.cc", 573 "src/google/protobuf/compiler/cpp/file.cc", 574 "src/google/protobuf/compiler/cpp/generator.cc", 575 "src/google/protobuf/compiler/cpp/helpers.cc", 576 "src/google/protobuf/compiler/cpp/ifndef_guard.cc", 577 "src/google/protobuf/compiler/cpp/message.cc", 578 "src/google/protobuf/compiler/cpp/namespace_printer.cc", 579 "src/google/protobuf/compiler/cpp/padding_optimizer.cc", 580 "src/google/protobuf/compiler/cpp/parse_function_generator.cc", 581 "src/google/protobuf/compiler/cpp/service.cc", 582 "src/google/protobuf/compiler/cpp/tracker.cc", 583 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", 584 "src/google/protobuf/compiler/csharp/csharp_enum.cc", 585 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", 586 "src/google/protobuf/compiler/csharp/csharp_field_base.cc", 587 "src/google/protobuf/compiler/csharp/csharp_generator.cc", 588 "src/google/protobuf/compiler/csharp/csharp_helpers.cc", 589 "src/google/protobuf/compiler/csharp/csharp_map_field.cc", 590 "src/google/protobuf/compiler/csharp/csharp_message.cc", 591 "src/google/protobuf/compiler/csharp/csharp_message_field.cc", 592 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", 593 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", 594 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", 595 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", 596 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", 597 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", 598 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", 599 "src/google/protobuf/compiler/csharp/names.cc", 600 "src/google/protobuf/compiler/java/context.cc", 601 "src/google/protobuf/compiler/java/doc_comment.cc", 602 "src/google/protobuf/compiler/java/field_common.cc", 603 "src/google/protobuf/compiler/java/file.cc", 604 "src/google/protobuf/compiler/java/full/enum.cc", 605 "src/google/protobuf/compiler/java/full/enum_field.cc", 606 "src/google/protobuf/compiler/java/full/extension.cc", 607 "src/google/protobuf/compiler/java/full/generator_factory.cc", 608 "src/google/protobuf/compiler/java/full/make_field_gens.cc", 609 "src/google/protobuf/compiler/java/full/map_field.cc", 610 "src/google/protobuf/compiler/java/full/message.cc", 611 "src/google/protobuf/compiler/java/full/message_builder.cc", 612 "src/google/protobuf/compiler/java/full/message_field.cc", 613 "src/google/protobuf/compiler/java/full/primitive_field.cc", 614 "src/google/protobuf/compiler/java/full/service.cc", 615 "src/google/protobuf/compiler/java/full/string_field.cc", 616 "src/google/protobuf/compiler/java/generator.cc", 617 "src/google/protobuf/compiler/java/helpers.cc", 618 "src/google/protobuf/compiler/java/internal_helpers.cc", 619 "src/google/protobuf/compiler/java/java_features.pb.cc", 620 "src/google/protobuf/compiler/java/lite/enum.cc", 621 "src/google/protobuf/compiler/java/lite/enum_field.cc", 622 "src/google/protobuf/compiler/java/lite/extension.cc", 623 "src/google/protobuf/compiler/java/lite/generator_factory.cc", 624 "src/google/protobuf/compiler/java/lite/make_field_gens.cc", 625 "src/google/protobuf/compiler/java/lite/map_field.cc", 626 "src/google/protobuf/compiler/java/lite/message.cc", 627 "src/google/protobuf/compiler/java/lite/message_builder.cc", 628 "src/google/protobuf/compiler/java/lite/message_field.cc", 629 "src/google/protobuf/compiler/java/lite/primitive_field.cc", 630 "src/google/protobuf/compiler/java/lite/string_field.cc", 631 "src/google/protobuf/compiler/java/message_serialization.cc", 632 "src/google/protobuf/compiler/java/name_resolver.cc", 633 "src/google/protobuf/compiler/java/names.cc", 634 "src/google/protobuf/compiler/java/shared_code_generator.cc", 635 "src/google/protobuf/compiler/kotlin/file.cc", 636 "src/google/protobuf/compiler/kotlin/generator.cc", 637 "src/google/protobuf/compiler/kotlin/message.cc", 638 "src/google/protobuf/compiler/objectivec/enum.cc", 639 "src/google/protobuf/compiler/objectivec/enum_field.cc", 640 "src/google/protobuf/compiler/objectivec/extension.cc", 641 "src/google/protobuf/compiler/objectivec/field.cc", 642 "src/google/protobuf/compiler/objectivec/file.cc", 643 "src/google/protobuf/compiler/objectivec/generator.cc", 644 "src/google/protobuf/compiler/objectivec/helpers.cc", 645 "src/google/protobuf/compiler/objectivec/import_writer.cc", 646 "src/google/protobuf/compiler/objectivec/line_consumer.cc", 647 "src/google/protobuf/compiler/objectivec/map_field.cc", 648 "src/google/protobuf/compiler/objectivec/message.cc", 649 "src/google/protobuf/compiler/objectivec/message_field.cc", 650 "src/google/protobuf/compiler/objectivec/names.cc", 651 "src/google/protobuf/compiler/objectivec/oneof.cc", 652 "src/google/protobuf/compiler/objectivec/primitive_field.cc", 653 "src/google/protobuf/compiler/objectivec/tf_decode_data.cc", 654 "src/google/protobuf/compiler/php/names.cc", 655 "src/google/protobuf/compiler/php/php_generator.cc", 656 "src/google/protobuf/compiler/plugin.cc", 657 "src/google/protobuf/compiler/plugin.pb.cc", 658 "src/google/protobuf/compiler/python/generator.cc", 659 "src/google/protobuf/compiler/python/helpers.cc", 660 "src/google/protobuf/compiler/python/pyi_generator.cc", 661 "src/google/protobuf/compiler/retention.cc", 662 "src/google/protobuf/compiler/ruby/ruby_generator.cc", 663 "src/google/protobuf/compiler/rust/accessors/accessor_case.cc", 664 "src/google/protobuf/compiler/rust/accessors/accessors.cc", 665 "src/google/protobuf/compiler/rust/accessors/default_value.cc", 666 "src/google/protobuf/compiler/rust/accessors/map.cc", 667 "src/google/protobuf/compiler/rust/accessors/repeated_field.cc", 668 "src/google/protobuf/compiler/rust/accessors/singular_cord.cc", 669 "src/google/protobuf/compiler/rust/accessors/singular_message.cc", 670 "src/google/protobuf/compiler/rust/accessors/singular_scalar.cc", 671 "src/google/protobuf/compiler/rust/accessors/singular_string.cc", 672 "src/google/protobuf/compiler/rust/accessors/unsupported_field.cc", 673 "src/google/protobuf/compiler/rust/accessors/with_presence.cc", 674 "src/google/protobuf/compiler/rust/context.cc", 675 "src/google/protobuf/compiler/rust/crate_mapping.cc", 676 "src/google/protobuf/compiler/rust/enum.cc", 677 "src/google/protobuf/compiler/rust/generator.cc", 678 "src/google/protobuf/compiler/rust/message.cc", 679 "src/google/protobuf/compiler/rust/naming.cc", 680 "src/google/protobuf/compiler/rust/oneof.cc", 681 "src/google/protobuf/compiler/rust/relative_path.cc", 682 "src/google/protobuf/compiler/rust/rust_field_type.cc", 683 "src/google/protobuf/compiler/rust/rust_keywords.cc", 684 "src/google/protobuf/compiler/rust/upb_helpers.cc", 685 "src/google/protobuf/compiler/subprocess.cc", 686 "src/google/protobuf/compiler/versions.cc", 687 "src/google/protobuf/compiler/zip_writer.cc", 688 "src/google/protobuf/testing/file.cc", 689 "third_party/utf8_range/utf8_validity.cc", 690 "upb_generator/common/names.cc", 691 "upb_generator/minitable/names.cc", 692 "upb_generator/minitable/names_internal.cc", 693 ] 694 include_dirs = [ 695 "src/google/protobuf/**/*.h", 696 "src/google/protobuf/**/*.inc", 697 "src", 698 "third_party/utf8_range", 699 "//third_party/protobuf", 700 ] 701 cflags_cc = [ 702 "-Wno-sign-compare", 703 "-Wno-unused-function", 704 "-Wno-unused-private-field", 705 "-Wno-deprecated-declarations", 706 ] 707 cflags = [ 708 "-Wno-sign-compare", 709 "-D HAVE_PTHREAD", 710 "-Wno-unused-function", 711 "-Wno-deprecated-declarations", 712 ] 713 714 deps = [ 715 ":protobuf_lite_static", 716 ":protobuf_static", 717 ] 718 external_deps = [ "abseil-cpp:absl_base_static" ] 719 public_configs = [ ":protobuf_config" ] 720 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 721 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 722} 723 724# Only compile the plugin for the host architecture. 725ohos_executable("protoc") { 726 sources = [ "src/google/protobuf/compiler/main.cc" ] 727 include_dirs = [ 728 "src/google/protobuf/**/*.h", 729 "src/google/protobuf/**/*.inc", 730 "src", 731 ] 732 deps = [ ":protoc_static_lib" ] 733 cflags_cc = [ 734 "-Wno-sign-compare", 735 "-Wno-deprecated-declarations", 736 ] 737 if (is_arkui_x) { 738 defines = [ "ARK_UI_X" ] 739 deps += [ "//third_party/abseil-cpp:absl_base_static" ] 740 } else { 741 external_deps = [ "abseil-cpp:absl_base_static" ] 742 } 743 if (is_mac || is_ios) { 744 frameworks = [ "Foundation.framework" ] 745 } 746 cflags = [ 747 "-Wno-sign-compare", 748 "-D HAVE_PTHREAD", 749 "-Wno-deprecated-declarations", 750 ] 751 install_enable = false 752 subsystem_name = "${THIRDPARTY_PROTOBUF_SUBSYS_NAME}" 753 part_name = "${THIRDPARTY_PROTOBUF_PART_NAME}" 754} 755