• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/config/clang/clang.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17
18# Config args
19declare_args() {
20  # ace debug flag, enable debug features: like dcheck, thread-checker, mem-monitor...
21  enable_ace_debug = false
22
23  # only available when 'enable_ace_debug' set to 'true', show the LOGD infos.
24  enable_ace_debug_log = true
25
26  # only available when 'enable_ace_debug' set to 'true', show the private logs.
27  enable_ace_private_log = true
28
29  # show the instance id in logs.
30  enable_ace_instance_log = true
31
32  # Disable glfw window to build for PC preview scenario.
33  enable_glfw_window = false
34
35  # Enable when build for cross platform
36  is_cross_platform_build = false
37}
38
39use_external_v8_snapshot = false
40use_shared_v8 = true
41enable_dump_drawcmd = false
42use_mingw_win = "${current_os}_${current_cpu}" == "mingw_x86_64"
43use_mac = "${current_os}_${current_cpu}" == "mac_x64"
44
45# Config path
46ace_root = "//foundation/ace/ace_engine"
47ace_napi = "//foundation/ace/napi"
48
49if (!defined(aosp_libs_dir)) {
50  aosp_libs_dir = "//prebuilts/aosp_prebuilt_libs/asdk_libs"
51}
52libs_root = "${aosp_libs_dir}/sdk"
53
54ace_flutter_engine_root = "$ace_root/build/external_config/flutter"
55flutter_root = "//third_party/flutter"
56v8_root = "//third_party/v8"
57ark_tools_root = "//prebuilts/ace-toolkit/ace-loader/panda"
58node_js_path = "//prebuilts/ace-toolkit/nodejs/node-v12.18.4-linux-x64/bin/"
59
60# Config toolchain
61windows_buildtool = "//build/toolchain/mingw:mingw_x86_64"
62if (!defined(default_aosp_source_dir)) {
63  default_aosp_source_dir = "/"
64}
65objcopy_default = "${default_aosp_source_dir}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/objcopy"
66objcopy_mingw = "${default_aosp_source_dir}/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/bin/objcopy"
67objcopy_x86_64 = "${default_aosp_source_dir}/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin/objcopy"
68mac_buildtool = "//build/toolchain/mac:clang_x64"
69objcopy_clang = "$clang_base_path/bin/llvm-objcopy"
70
71if (is_standard_system) {
72  objcopy_default = "//prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-objcopy"
73  node_js_path =
74      "//prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/"
75} else if (is_cross_platform_build && defined(aosp_objcopy)) {
76  objcopy_default = aosp_objcopy
77}
78
79# Config part name
80if (is_standard_system) {
81  ace_engine_part = "ace_engine_standard"
82  hilog_deps = [ "hiviewdfx_hilog_native:libhilog" ]
83  ark_runtime_path = "//ark/runtime_core"
84} else {
85  ace_engine_part = "ace_engine_full"
86  hilog_deps = [ "hilog:libhilog" ]
87  ark_runtime_path = "//ark/runtime"
88}
89
90# Config defines
91ace_wearable_defines = [ "WEARABLE_PRODUCT" ]
92ace_ivi_defines = [ "IVI_PRODUCT" ]
93ace_common_defines = [ "ACE_LOG_TAG=\"Ace\"" ]
94
95if (enable_glfw_window) {
96  ace_common_defines += [ "USE_GLFW_WINDOW" ]
97}
98
99if (use_clang_coverage) {
100  ace_common_defines += [ "USE_CLANG_COVERAGE" ]
101}
102
103if (enable_ace_debug) {
104  ace_common_defines += [ "ACE_DEBUG" ]
105  if (enable_ace_debug_log) {
106    ace_common_defines += [ "ACE_DEBUG_LOG" ]
107  }
108  if (enable_ace_private_log) {
109    ace_common_defines += [ "ACE_PRIVATE_LOG" ]
110  }
111}
112
113if (enable_ace_instance_log) {
114  ace_common_defines += [ "ACE_INSTANCE_LOG" ]
115}
116
117if (enable_dump_drawcmd) {
118  ace_common_defines += [ "DUMP_DRAW_CMD" ]
119}
120
121ace_platforms = []
122
123_ace_adapter_dir = rebase_path("$ace_root/adapter", root_build_dir)
124_adapters = exec_script("build/search.py", [ _ace_adapter_dir ], "list lines")
125foreach(item, _adapters) {
126  import_var = {
127  }
128  import_var = {
129    import("$ace_root/adapter/$item/build/platform.gni")
130  }
131
132  if (defined(import_var.platforms)) {
133    foreach(platform, import_var.platforms) {
134      if (defined(platform.name)) {
135        ace_platforms += [ platform ]
136      }
137    }
138  }
139}
140
141print(ace_platforms)
142