# Copyright (c) 2021 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/ace/ace_engine/ace_config.gni") template("declarative_js_engine_qjs") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { defines += invoker.defines configs = [ "$ace_root:ace_config" ] sources = [ "content_storage_set.cpp", "js_converter.cpp", "modules/qjs_curves_module.cpp", "modules/qjs_matrix4_module.cpp", "modules/qjs_module_manager.cpp", "modules/qjs_router_module.cpp", "qjs_bindings.cpp", "qjs_declarative_engine.cpp", "qjs_declarative_engine_instance.cpp", "qjs_function_list_entries_container.cpp", "qjs_helpers.cpp", "qjs_object_template.cpp", "qjs_types.cpp", "qjs_unwrap_any.cpp", "qjs_view_register.cpp", ] deps = [ "$ace_root/frameworks/core/components/theme:build_theme_code", "//third_party/quickjs:qjs", ] if (defined(config.use_build_in_js_engine) && config.use_build_in_js_engine) { defines += [ "BUILT_IN_JS_ENGINE" ] deps += [ "$ace_root/frameworks/bridge/js_frontend/engine/quickjs/intl:intl_qjs_static" ] } else { deps += [ "$ace_root/frameworks/bridge/js_frontend/engine/quickjs/intl:intl_qjs", ] sources += [ "$ace_root/frameworks/bridge/js_frontend/engine/quickjs/qjs_group_js_bridge.cpp", "$ace_root/frameworks/bridge/js_frontend/engine/quickjs/qjs_utils.cpp", ] } # if napi support deps += [ "//foundation/ace/napi:ace_napi_quickjs" ] public_deps = [ "//foundation/ace/napi:ace_napi" ] } } 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) { if (engine.engine_name == "qjs") { declarative_js_engine_qjs("declarative_js_engine_bridge_qjs_$platform") { defines = engine.engine_defines config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines += config.defines } } } } }