# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") config("phonenumber_config") { include_dirs = [ "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", "//third_party/icu/icu4c/source", "//third_party/libphonenumber/cpp/src", "//third_party/protobuf/src", "//third_party/protobuf/src/google", "//third_party/protobuf/src/google/protobuf", ] cflags = [ "-Wno-implicit-fallthrough" ] cflags_cc = [ "-DI18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", "-DI18N_PHONENUMBERS_USE_ICU_REGEXP", "-Dphonenumber_shared_EXPORTS", "-Wall", "-fPIC", "-frtti", "-U__ANDROID__", "-Wno-sign-compare", "-Wno-error=unused-parameter", "-Wno-error=unused-const-variable", "-Wno-error=unneeded-internal-declaration", "-Wno-implicit-fallthrough", ] } phonenumber_source = [ "src/phonenumbers/phonenumber.cc", "src/phonenumbers/default_logger.cc", "src/phonenumbers/phonenumbermatch.cc", "src/phonenumbers/phonenumbermatcher.cc", "src/phonenumbers/regexp_cache.cc", "src/phonenumbers/phonemetadata.pb.cc", "src/phonenumbers/string_byte_sink.cc", "src/phonenumbers/asyoutypeformatter.cc", "src/phonenumbers/phonenumberutil.cc", "src/phonenumbers/regexp_adapter_icu.cc", "src/phonenumbers/phonenumber.pb.cc", "src/phonenumbers/base/strings/string_piece.cc", "src/phonenumbers/alternate_format.cc", "src/phonenumbers/shortnumberinfo.cc", "src/phonenumbers/utf/unilib.cc", "src/phonenumbers/utf/unicodetext.cc", "src/phonenumbers/metadata.cc", "src/phonenumbers/short_metadata.cc", "src/phonenumbers/regex_based_matcher.cc", "src/phonenumbers/logger.cc", "src/phonenumbers/stringutil.cc", "src/phonenumbers/unicodestring.cc", "src/phonenumbers/utf/rune.c", ] ohos_shared_library("phonenumber_standard") { configs = [ ":phonenumber_config", "//build/config/compiler:rtti", ] sources = phonenumber_source deps = [ "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", "//third_party/protobuf/src:protobuf_standard", ] defines = [ "I18N_PHONENUMBERS_USE_ALTERNATE_FORMATS", "I18N_PHONENUMBERS_USE_ICU_REGEXP", "HAVE_PTHREAD", ] remove_configs = [ "//build/config/compiler:no_rtti" ] ldflags = [ "-shared" ] subsystem_name = "global" part_name = "i18n_standard" install_enable = true }