# 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/arkui/ace_engine/ace_config.gni") config("ace_napi_v8_config") { include_dirs = [ "//foundation/arkui/napi", "//third_party/libuv/include", "//third_party/v8/include", "//commonlibrary/c_utils/base/include", ] } template("ace_napi_impl") { ohos_source_set(target_name) { public_configs = [ ":ace_napi_v8_config" ] include_dirs = [ "//foundation/arkui/napi/native_engine/impl/v8" ] defines = invoker.engine_defines if (target_cpu == "arm64") { defines += [ "APP_USE_ARM64" ] } else if (target_cpu == "arm") { defines += [ "APP_USE_ARM" ] } sources = [ "native_value/v8_native_array.cpp", "native_value/v8_native_array_buffer.cpp", "native_value/v8_native_boolean.cpp", "native_value/v8_native_data_view.cpp", "native_value/v8_native_external.cpp", "native_value/v8_native_function.cpp", "native_value/v8_native_number.cpp", "native_value/v8_native_object.cpp", "native_value/v8_native_string.cpp", "native_value/v8_native_typed_array.cpp", "native_value/v8_native_value.cpp", "v8_native_deferred.cpp", "v8_native_engine.cpp", "v8_native_reference.cpp", ] configs = [ "//third_party/v8:v8_header_features" ] deps = [ "//foundation/arkui/napi:ace_napi", "//third_party/v8:v8_shared", ] external_deps = hilog_deps } } foreach(item, ace_platforms) { if (item.name == "ohos") { engine_config = item.config support_engines = engine_config.js_engines foreach(engine, support_engines) { if (engine.engine_name == "v8") { ace_napi_impl("ace_napi_impl_v8") { engine_defines = engine.engine_defines } } } } }