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 "configuration", 24 "device", 25 "font", 26 "grid", 27 "measure", 28 "mediaquery", 29 "prompt", 30 "promptaction", 31 "router", 32 "animator", 33] 34 35template("ace_napi_lib") { 36 forward_variables_from(invoker, "*") 37 38 target_names = string_split(target_name, "/") 39 prefix_dir = target_names[0] 40 41 module_path = prefix_dir 42 install_dir = "" 43 if (prefix_dir != target_name) { 44 module_path = target_names[1] 45 install_dir = "/" + prefix_dir 46 } 47 48 module_name = string_replace(module_path, "_", "") 49 50 ohos_shared_library(module_name) { 51 if (current_os == "ohos") { 52 sanitize = { 53 integer_overflow = true 54 boundary_sanitize = true 55 debug = ace_sanitize_debug 56 } 57 } 58 deps = [ "$ace_root/interfaces/napi/kits/${module_path}:${module_name}_static_${platform}" ] 59 60 cflags = [] 61 ldflags = [] 62 if (ace_engine_feature_enable_coverage) { 63 cflags += [ "--coverage" ] 64 ldflags += [ "--coverage" ] 65 } 66 67 relative_install_dir = "module" + install_dir 68 part_name = ace_engine_part 69 subsystem_name = ace_engine_subsystem 70 } 71} 72