1# Copyright (c) 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 17configs = [ "$ace_root:ace_config" ] 18 19template("napi_componentutils_static") { 20 forward_variables_from(invoker, "*") 21 22 ohos_source_set(target_name) { 23 defines += invoker.defines 24 cflags_cc += invoker.cflags_cc 25 if (is_mac) { 26 cflags_cc += [ "-O0" ] 27 } 28 29 include_dirs = [ 30 "$ace_root", 31 "$ace_root/frameworks", 32 "$root_out_dir/arkui/framework", 33 ] 34 35 sources = [ "js_component_utils.cpp" ] 36 if (platform != "ohos" || is_asan) { 37 sources += [ "$ace_root/frameworks/base/geometry/matrix4.cpp" ] 38 } 39 deps = [] 40 if (platform != "" && is_arkui_x) { 41 deps += [ "${crossplatform_plugin_root}/libs/napi:napi_$platform" ] 42 } else { 43 external_deps = [ "napi:ace_napi" ] 44 } 45 46 if (defined(config.libace_target)) { 47 deps += [ config.libace_target ] 48 } 49 50 deps += [ "../utils:napi_utils_static_${platform}" ] 51 52 subsystem_name = ace_engine_subsystem 53 part_name = ace_engine_part 54 } 55} 56 57foreach(item, ace_platforms) { 58 napi_componentutils_static("componentutils_static_" + item.name) { 59 defines = [] 60 cflags_cc = [] 61 platform = item.name 62 config = { 63 } 64 65 if (defined(item.config)) { 66 config = item.config 67 } 68 69 if (defined(config.defines)) { 70 defines = config.defines 71 } 72 73 if (defined(config.cflags_cc)) { 74 cflags_cc = config.cflags_cc 75 } 76 } 77} 78