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("//base/global/i18n_lite/i18n_lite.gni") 15if (defined(ohos_lite)) { 16 import("//build/lite/config/component/lite_component.gni") 17} else { 18 import("//build/ohos.gni") 19} 20 21locale_sources = [ 22 "src/data_resource.cpp", 23 "src/date_time_data.cpp", 24 "src/date_time_format.cpp", 25 "src/date_time_format_impl.cpp", 26 "src/locale_info.cpp", 27 "src/measure_format.cpp", 28 "src/measure_format_impl.cpp", 29 "src/number_data.cpp", 30 "src/number_format.cpp", 31 "src/number_format_impl.cpp", 32 "src/plural_format.cpp", 33 "src/plural_format_impl.cpp", 34 "src/plural_rules.cpp", 35 "src/str_util.cpp", 36 "src/week_info.cpp", 37] 38 39config("locale_config") { 40 include_dirs = [ 41 "//base/global/i18n_lite/interfaces/kits/i18n/include", 42 "//base/global/i18n_lite/frameworks/i18n/include", 43 "//third_party/bounds_checking_function/include", 44 ] 45} 46 47copy("global_dat") { 48 sources = [ "i18n.dat" ] 49 outputs = [ "$root_out_dir/data/i18n.dat" ] 50} 51 52if (defined(ohos_lite)) { 53 if (ohos_kernel_type == "liteos_m") { 54 static_library("global_i18n") { 55 sources = locale_sources 56 public_configs = [ ":locale_config" ] 57 deps = [ 58 ":global_dat", 59 "//third_party/bounds_checking_function:libsec_static", 60 ] 61 if (i18n_lite_support_i18n_product) { 62 include_dirs = [ "//commonlibrary/utils_lite/memory/include" ] 63 defines = [ "I18N_PRODUCT" ] 64 deps += [ "//commonlibrary/utils_lite:utils" ] 65 } 66 67 } 68 } else { 69 shared_library("global_i18n") { 70 sources = locale_sources 71 public_configs = [ ":locale_config" ] 72 deps = [ 73 ":global_dat", 74 "//third_party/bounds_checking_function:libsec_shared", 75 ] 76 } 77 } 78 79 lite_component("locale_lite") { 80 features = [ ":global_i18n" ] 81 } 82} else { 83 ohos_static_library("global_i18n_simulator") { 84 sources = locale_sources 85 configs += [ ":locale_config" ] 86 deps = [ ":global_dat" ] 87 } 88} 89