# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") # build service backend javascript engine library template("js_pa_engine") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { subsystem_name = ace_engine_subsystem part_name = ace_engine_part defines += invoker.defines configs = [ "$ace_root:ace_config" ] deps = [] if (use_js_debug) { deps += [ "${engine_path}:js_pa_engine_bridge_${engine_name}_debug_$platform", ] } else { deps += [ "${engine_path}:js_pa_engine_bridge_${engine_name}_$platform" ] } deps += [ "$ace_root/build:libace_compatible" ] if (defined(config.build_container_scope_lib) && config.build_container_scope_lib) { external_deps = [ "napi:ace_container_scope" ] } } } # dynamic generate js_engine targets foreach(item, ace_platforms) { platform = item.name engine_config = { } engine_config = item.config support_engines = [] support_engines = engine_config.js_engines foreach(engine, support_engines) { js_pa_engine("js_pa_engine_${engine.engine_name}_$platform") { platform = item.name engine_name = engine.engine_name engine_path = engine.engine_path defines = engine.engine_defines use_js_debug = false config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines += config.defines } } if (defined(engine.have_debug) && engine.have_debug) { js_pa_engine("js_pa_engine_${engine.engine_name}_debug_$platform") { platform = item.name engine_name = engine.engine_name engine_path = engine.engine_path defines = engine.engine_defines use_js_debug = true config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines += config.defines } } } } }