• 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")
15config("phonenumber_config") {
16  include_dirs = [
17    "//third_party/icu/icu4c/source/common",
18    "//third_party/icu/icu4c/source/i18n",
19    "//third_party/icu/icu4c/source",
20    "//third_party/libphonenumber/cpp/src",
21    "//third_party/protobuf/src",
22    "//third_party/protobuf/src/google",
23    "//third_party/protobuf/src/google/protobuf",
24  ]
25  cflags = [ "-Wno-implicit-fallthrough" ]
26  cflags_cc = [
27    "-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
28    "-DI18N_PHONENUMBERS_USE_ICU_REGEXP",
29    "-Dphonenumber_shared_EXPORTS",
30    "-Wall",
31    "-fPIC",
32    "-frtti",
33    "-U__ANDROID__",
34    "-Wno-sign-compare",
35    "-Wno-error=unused-parameter",
36    "-Wno-error=unused-const-variable",
37    "-Wno-error=unneeded-internal-declaration",
38    "-Wno-implicit-fallthrough",
39  ]
40}
41
42phonenumber_source = [
43  "src/phonenumbers/phonenumber.cc",
44  "src/phonenumbers/default_logger.cc",
45  "src/phonenumbers/phonenumbermatch.cc",
46  "src/phonenumbers/phonenumbermatcher.cc",
47  "src/phonenumbers/regexp_cache.cc",
48  "src/phonenumbers/phonemetadata.pb.cc",
49  "src/phonenumbers/string_byte_sink.cc",
50  "src/phonenumbers/asyoutypeformatter.cc",
51  "src/phonenumbers/phonenumberutil.cc",
52  "src/phonenumbers/regexp_adapter_icu.cc",
53  "src/phonenumbers/phonenumber.pb.cc",
54  "src/phonenumbers/base/strings/string_piece.cc",
55  "src/phonenumbers/alternate_format.cc",
56  "src/phonenumbers/shortnumberinfo.cc",
57  "src/phonenumbers/utf/unilib.cc",
58  "src/phonenumbers/utf/unicodetext.cc",
59  "src/phonenumbers/metadata.cc",
60  "src/phonenumbers/short_metadata.cc",
61  "src/phonenumbers/regex_based_matcher.cc",
62  "src/phonenumbers/logger.cc",
63  "src/phonenumbers/stringutil.cc",
64  "src/phonenumbers/unicodestring.cc",
65  "src/phonenumbers/utf/rune.c",
66]
67
68ohos_shared_library("phonenumber_standard") {
69  configs = [
70    ":phonenumber_config",
71    "//build/config/compiler:rtti",
72  ]
73  sources = phonenumber_source
74  deps = [
75    "//third_party/icu/icu4c:shared_icui18n",
76    "//third_party/icu/icu4c:shared_icuuc",
77    "//third_party/protobuf/src:protobuf_standard",
78  ]
79  defines = [
80    "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS",
81    "I18N_PHONENUMBERS_USE_ICU_REGEXP",
82    "HAVE_PTHREAD",
83  ]
84  remove_configs = [ "//build/config/compiler:no_rtti" ]
85  ldflags = [ "-shared" ]
86  subsystem_name = "global"
87  part_name = "i18n_standard"
88  install_enable = true
89}
90