• 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/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    "-Wno-deprecated-builtins",
47  ]
48}
49
50phonenumber_source = [
51  "src/phonenumbers/phonenumber.cc",
52  "src/phonenumbers/default_logger.cc",
53  "src/phonenumbers/phonenumbermatch.cc",
54  "src/phonenumbers/phonenumbermatcher.cc",
55  "src/phonenumbers/regexp_cache.cc",
56  "src/phonenumbers/phonemetadata.pb.cc",
57  "src/phonenumbers/string_byte_sink.cc",
58  "src/phonenumbers/asyoutypeformatter.cc",
59  "src/phonenumbers/phonenumberutil.cc",
60  "src/phonenumbers/regexp_adapter_icu.cc",
61  "src/phonenumbers/phonenumber.pb.cc",
62  "src/phonenumbers/base/strings/string_piece.cc",
63  "src/phonenumbers/alternate_format.cc",
64  "src/phonenumbers/shortnumberinfo.cc",
65  "src/phonenumbers/utf/unilib.cc",
66  "src/phonenumbers/utf/unicodetext.cc",
67  "src/phonenumbers/metadata.cc",
68  "src/phonenumbers/short_metadata.cc",
69  "src/phonenumbers/regex_based_matcher.cc",
70  "src/phonenumbers/logger.cc",
71  "src/phonenumbers/stringutil.cc",
72  "src/phonenumbers/unicodestring.cc",
73  "src/phonenumbers/utf/rune.c",
74]
75
76ohos_shared_library("phonenumber_standard") {
77  configs = [ ":phonenumber_config" ]
78  sources = phonenumber_source
79  deps = [
80    "//third_party/abseil-cpp:absl_base",
81    "//third_party/abseil-cpp:absl_strings",
82    "//third_party/icu/icu4c:shared_icui18n",
83    "//third_party/icu/icu4c:shared_icuuc",
84    "//third_party/protobuf:protobuf_lite",
85  ]
86  defines = [
87    "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
88    "I18N_PHONENUMBERS_USE_ICU_REGEXP",
89    "HAVE_PTHREAD",
90  ]
91  innerapi_tags = [ "platformsdk_indirect" ]
92  part_name = "libphonenumber"
93  subsystem_name = "thirdparty"
94  ldflags = [ "-shared" ]
95  install_enable = true
96}
97
98ohos_shared_library("geocoding") {
99  configs = [ ":phonenumber_config" ]
100  sources = [
101    "src/phonenumbers/geocoding/area_code_map.cc",
102    "src/phonenumbers/geocoding/default_map_storage.cc",
103    "src/phonenumbers/geocoding/geocoding_data.cc",
104    "src/phonenumbers/geocoding/geocoding_warpper.cc",
105    "src/phonenumbers/geocoding/mapping_file_provider.cc",
106    "src/phonenumbers/geocoding/phonenumber_offline_geocoder.cc",
107    "src/phonenumbers/phonenumber.pb.h",
108  ]
109  deps = [
110    "//third_party/icu/icu4c:shared_icuuc",
111    "//third_party/libphonenumber/cpp:phonenumber_standard",
112  ]
113  defines = [
114    "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
115    "I18N_PHONENUMBERS_USE_ICU_REGEXP",
116    "HAVE_PTHREAD",
117  ]
118  part_name = "libphonenumber"
119  subsystem_name = "thirdparty"
120  ldflags = [ "-shared" ]
121  install_enable = true
122}
123