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("//build/ohos.gni") 15import("//foundation/arkui/ace_engine/ace_config.gni") 16import("napi_lib.gni") 17 18common_targets = [] 19foreach(module, common_napi_libs) { 20 if (use_mac) { 21 ace_napi_lib(module) { 22 platform = "mac" 23 } 24 } else if (use_mingw_win) { 25 ace_napi_lib(module) { 26 platform = "windows" 27 } 28 } else if (use_linux) { 29 ace_napi_lib(module) { 30 platform = "linux" 31 } 32 } else if (!is_arkui_x) { 33 ace_napi_lib(module) { 34 # napi libs remain isolate in libace.z.so and asan version 35 if (is_asan) { 36 platform = "ohos" 37 } else { 38 platform = "ohos_ng" 39 } 40 } 41 } 42 43 module_path_names = [] 44 module_path_names = string_split(module, "/") 45 prefix_dir = module_path_names[0] 46 47 module_path = prefix_dir 48 if (prefix_dir != module) { 49 module_path = module_path_names[1] 50 } 51 52 module_name = string_replace(module_path, "_", "") 53 common_targets += [ ":$module_name" ] 54} 55 56group("napi_group") { 57 if (use_mac || use_mingw_win || use_linux) { 58 public_deps = common_targets 59 } else { 60 deps = common_targets 61 deps += [ 62 "$ace_root/interfaces/napi/kits/drawabledescriptor:drawabledescriptor", 63 "$ace_root/interfaces/napi/kits/plugincomponent:plugincomponent", 64 ] 65 } 66} 67