# 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") import("//foundation/arkui/ace_engine/ace_config.gni") config("ace_base_i18n_config") { defines = [ "ACEL10N" ] } template("ace_base_i18n") { forward_variables_from(invoker, "*") source_set(target_name) { defines += invoker.defines cflags_cc += invoker.cflags_cc deps = [ "$ace_root/frameworks/base/resource:ace_resource" ] if (defined(config.use_external_icu)) { if (config.use_external_icu == "shared") { deps += [ "//third_party/icu/icu4c:shared_icui18n" ] } else if (config.use_external_icu == "static") { deps += [ "//third_party/icu/icu4c:static_icui18n" ] } configs += [ "$ace_flutter_engine_root/icu:icu_config_$platform" ] } else { if (ace_use_rosen_drawing) { if (platform == "ohos") { deps += [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ] } else { include_dirs = [ "$skia_root_new/third_party/externals/icu/source/common", "$skia_root_new/third_party/externals/icu/source/i18n/", ] } } else { deps += [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ] } } configs += [ ":ace_base_i18n_config", "$ace_root:ace_config", ] # add base source file here sources = [ "localization.cpp" ] } } foreach(item, ace_platforms) { ace_base_i18n("ace_base_i18n_" + item.name) { platform = item.name defines = [] cflags_cc = [] config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines = config.defines } if (defined(config.cflags_cc)) { cflags_cc = config.cflags_cc } } }