1# Copyright (c) 2024 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/i18n.gni") 15import("//build/ohos.gni") 16 17group("build_module") { 18 deps = [ ":cj_i18n_ffi" ] 19} 20 21ohos_shared_library("cj_i18n_ffi") { 22 include_dirs = [ 23 "../../frameworks/intl/include", 24 "../js/kits/include", 25 ] 26 27 cflags_cc = [ "-frtti" ] 28 remove_configs = [ "//build/config/compiler:no_rtti" ] 29 30 if (!defined(defines)) { 31 defines = [] 32 } 33 34 if (!build_ohos_sdk) { 35 deps = [ 36 "../../frameworks/intl:intl_util", 37 "../../frameworks/intl:preferred_language", 38 ] 39 external_deps = [ 40 "c_utils:utils", 41 "hilog:libhilog", 42 "icu:shared_icui18n", 43 "icu:shared_icuuc", 44 "napi:ace_napi", 45 "napi:cj_bind_ffi", 46 "napi:cj_bind_native", 47 ] 48 sources = [ "i18n_ffi.cpp" ] 49 } else { 50 defines += [ "PREVIEWER" ] 51 sources = [ "cj_i18n_mock.cpp" ] 52 external_deps = [ "napi:cj_bind_ffi" ] 53 } 54 55 if (current_os == "ohos") { 56 defines += [ "OHOS_PLATFORM" ] 57 } 58 59 if (current_os == "mingw") { 60 defines += [ "WINDOWS_PLATFORM" ] 61 } 62 63 innerapi_tags = [ "platformsdk" ] 64 subsystem_name = "global" 65 part_name = "i18n" 66} 67