1# Copyright (c) 2022-2023 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") 16 17common_napi_libs = [ 18 # napi .so needs to be all lower case 19 "arkui/componentutils", 20 "arkui/component_snapshot", 21 "arkui/drag_controller", 22 "arkui/inspector", 23 "arkui/observer", 24 "configuration", 25 "device", 26 "font", 27 "grid", 28 "measure", 29 "mediaquery", 30 "prompt", 31 "promptaction", 32 "router", 33 "animator", 34 "atomic_service_bar", 35 "graphics/display_sync", 36] 37 38if (!is_arkui_x) { 39 common_napi_libs += [ "arkui/performancemonitor" ] 40} 41 42template("ace_napi_lib") { 43 forward_variables_from(invoker, "*") 44 45 target_names = string_split(target_name, "/") 46 prefix_dir = target_names[0] 47 48 module_path = prefix_dir 49 install_dir = "" 50 if (prefix_dir != target_name) { 51 module_path = target_names[1] 52 install_dir = "/" + prefix_dir 53 } 54 55 module_name = string_replace(module_path, "_", "") 56 57 ohos_shared_library(module_name) { 58 if (current_os == "ohos") { 59 sanitize = { 60 integer_overflow = true 61 boundary_sanitize = true 62 debug = ace_sanitize_debug 63 } 64 } 65 deps = [ "$ace_root/interfaces/napi/kits/${module_path}:${module_name}_static_${platform}" ] 66 67 cflags = [] 68 ldflags = [] 69 if (ace_engine_feature_enable_coverage) { 70 cflags += [ "--coverage" ] 71 ldflags += [ "--coverage" ] 72 } 73 74 relative_install_dir = "module" + install_dir 75 part_name = ace_engine_part 76 subsystem_name = ace_engine_subsystem 77 } 78} 79