• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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
14napi_path = "//foundation//arkui/napi"
15ets_runtime_path = "//arkcompiler/ets_runtime"
16# Set is enable data_protector
17enabled_data_protector = false
18
19napi_sources = [
20  "callback_scope_manager/native_callback_scope_manager.cpp",
21  "module_manager/module_checker_delegate.cpp",
22  "module_manager/module_load_checker.cpp",
23  "module_manager/native_module_manager.cpp",
24  "native_engine/impl/ark/ark_idle_monitor.cpp",
25  "native_engine/impl/ark/ark_native_deferred.cpp",
26  "native_engine/impl/ark/ark_native_engine.cpp",
27  "native_engine/impl/ark/ark_native_reference.cpp",
28  "native_engine/impl/ark/ark_native_timer.cpp",
29  "native_engine/impl/ark/cj_support.cpp",
30  "native_engine/native_api.cpp",
31  "native_engine/native_async_work.cpp",
32  "native_engine/native_create_env.cpp",
33  "native_engine/native_engine.cpp",
34  "native_engine/native_event.cpp",
35  "native_engine/native_node_api.cpp",
36  "native_engine/native_node_hybrid_api.cpp",
37  "native_engine/native_safe_async_work.cpp",
38  "native_engine/native_sendable.cpp",
39  "native_engine/worker_manager.cpp",
40  "reference_manager/native_reference_manager.cpp",
41  "utils/data_protector.cpp",
42  "utils/log.cpp",
43]
44
45# supported for hybrid
46napi_sources += [
47  "native_engine/impl/ark/ark_hybrid_native_reference.cpp",
48]
49
50if (is_mingw) {
51  napi_sources += [ "utils/platform/windows/file.cpp" ]
52} else {
53  napi_sources += [ "utils/platform/unix_like/file.cpp" ]
54}
55
56declare_args() {
57  napi_enable_container_scope = false
58  napi_enable_memleak_debug = true
59
60  # Enable pgo for building
61  napi_feature_enable_pgo = false
62
63  # Set pgo profdata path
64  napi_feature_pgo_path = ""
65}
66
67if (defined(target_cpu) && target_cpu == "arm64" &&
68    !(defined(is_arkui_x) && is_arkui_x) && is_ohos && !is_emulator) {
69  enabled_data_protector = true
70}
71
72is_ohos_standard_system = is_standard_system && !is_arkui_x
73
74module_output_path = "napi/napi"
75
76if (!defined(ark_standalone_build)) {
77  ark_standalone_build = false
78}
79