• 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
16group("build_module") {
17  deps = [
18    ":geocoding",
19    ":phonenumber_standard",
20  ]
21}
22config("phonenumber_config") {
23  include_dirs = [
24    "//third_party/abseil-cpp",
25    "//third_party/icu/icu4c/source/common",
26    "//third_party/icu/icu4c/source/i18n",
27    "//third_party/icu/icu4c/source",
28    "//third_party/libphonenumber/cpp/src",
29    "//third_party/protobuf/src",
30    "//third_party/protobuf/src/google",
31    "//third_party/protobuf/src/google/protobuf",
32  ]
33  cflags = [ "-Wno-implicit-fallthrough" ]
34  cflags_cc = [
35    "-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
36    "-DI18N_PHONENUMBERS_USE_ICU_REGEXP",
37    "-Dphonenumber_shared_EXPORTS",
38    "-Wall",
39    "-fPIC",
40    "-U__ANDROID__",
41    "-Wno-sign-compare",
42    "-Wno-error=unused-parameter",
43    "-Wno-error=unused-const-variable",
44    "-Wno-error=unneeded-internal-declaration",
45    "-Wno-implicit-fallthrough",
46  ]
47}
48
49phonenumber_source = [
50  "src/phonenumbers/phonenumber.cc",
51  "src/phonenumbers/default_logger.cc",
52  "src/phonenumbers/phonenumbermatch.cc",
53  "src/phonenumbers/phonenumbermatcher.cc",
54  "src/phonenumbers/regexp_cache.cc",
55  "src/phonenumbers/phonemetadata.pb.cc",
56  "src/phonenumbers/string_byte_sink.cc",
57  "src/phonenumbers/asyoutypeformatter.cc",
58  "src/phonenumbers/phonenumberutil.cc",
59  "src/phonenumbers/regexp_adapter_icu.cc",
60  "src/phonenumbers/phonenumber.pb.cc",
61  "src/phonenumbers/base/strings/string_piece.cc",
62  "src/phonenumbers/alternate_format.cc",
63  "src/phonenumbers/shortnumberinfo.cc",
64  "src/phonenumbers/utf/unilib.cc",
65  "src/phonenumbers/utf/unicodetext.cc",
66  "src/phonenumbers/metadata.cc",
67  "src/phonenumbers/short_metadata.cc",
68  "src/phonenumbers/regex_based_matcher.cc",
69  "src/phonenumbers/logger.cc",
70  "src/phonenumbers/stringutil.cc",
71  "src/phonenumbers/unicodestring.cc",
72  "src/phonenumbers/utf/rune.c",
73]
74
75ohos_shared_library("phonenumber_standard") {
76  configs = [ ":phonenumber_config" ]
77  sources = phonenumber_source
78  deps = [
79    "//third_party/abseil-cpp/absl/base:absl_base",
80    "//third_party/abseil-cpp/absl/strings:absl_strings",
81    "//third_party/icu/icu4c:shared_icui18n",
82    "//third_party/icu/icu4c:shared_icuuc",
83    "//third_party/protobuf:protobuf_lite",
84  ]
85  defines = [
86    "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
87    "I18N_PHONENUMBERS_USE_ICU_REGEXP",
88    "HAVE_PTHREAD",
89  ]
90  part_name = "libphonenumber"
91  subsystem_name = "thirdparty"
92  ldflags = [ "-shared" ]
93  install_enable = true
94}
95
96ohos_shared_library("geocoding") {
97  configs = [ ":phonenumber_config" ]
98  sources = [
99    "src/phonenumbers/geocoding/area_code_map.cc",
100    "src/phonenumbers/geocoding/default_map_storage.cc",
101    "src/phonenumbers/geocoding/geocoding_data.cc",
102    "src/phonenumbers/geocoding/geocoding_warpper.cc",
103    "src/phonenumbers/geocoding/mapping_file_provider.cc",
104    "src/phonenumbers/geocoding/phonenumber_offline_geocoder.cc",
105    "src/phonenumbers/phonenumber.pb.h",
106  ]
107  deps = [
108    "//third_party/icu/icu4c:shared_icuuc",
109    "//third_party/libphonenumber/cpp:phonenumber_standard",
110  ]
111  defines = [
112    "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
113    "I18N_PHONENUMBERS_USE_ICU_REGEXP",
114    "HAVE_PTHREAD",
115  ]
116  part_name = "libphonenumber"
117  subsystem_name = "thirdparty"
118  ldflags = [ "-shared" ]
119  install_enable = true
120}
121