# 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("//base/global/i18n_lite/i18n_lite.gni") if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") } else { import("//build/ohos.gni") } locale_sources = [ "src/data_resource.cpp", "src/date_time_data.cpp", "src/date_time_format.cpp", "src/date_time_format_impl.cpp", "src/locale_info.cpp", "src/measure_format.cpp", "src/measure_format_impl.cpp", "src/number_data.cpp", "src/number_format.cpp", "src/number_format_impl.cpp", "src/plural_format.cpp", "src/plural_format_impl.cpp", "src/plural_rules.cpp", "src/str_util.cpp", "src/week_info.cpp", ] config("locale_config") { include_dirs = [ "//base/global/i18n_lite/interfaces/kits/i18n/include", "//base/global/i18n_lite/frameworks/i18n/include", "//third_party/bounds_checking_function/include", ] } copy("global_dat") { sources = [ "i18n.dat" ] outputs = [ "$root_out_dir/data/i18n.dat" ] } if (defined(ohos_lite)) { if (ohos_kernel_type == "liteos_m") { static_library("global_i18n") { sources = locale_sources public_configs = [ ":locale_config" ] deps = [ ":global_dat", "//third_party/bounds_checking_function:libsec_static", ] if (i18n_lite_support_i18n_product) { include_dirs = [ "//commonlibrary/utils_lite/memory/include" ] defines = [ "I18N_PRODUCT" ] deps += [ "//commonlibrary/utils_lite:utils" ] } } } else { shared_library("global_i18n") { sources = locale_sources public_configs = [ ":locale_config" ] deps = [ ":global_dat", "//third_party/bounds_checking_function:libsec_shared", ] } } lite_component("locale_lite") { features = [ ":global_i18n" ] } } else { ohos_static_library("global_i18n_simulator") { sources = locale_sources configs += [ ":locale_config" ] deps = [ ":global_dat" ] } }