• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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
14if (!defined(ark_standalone_build)) {
15  ark_standalone_build = false
16}
17
18declare_args() {
19  # If true, use icu to implement Intl APIs.
20  # If false, use @ohos.intl APIs to implement Intl APIs.
21  enable_ark_intl = true
22}
23
24if (!ark_standalone_build) {
25  build_root = "//build"
26  ark_third_party_root = "//third_party"
27  import("$build_root/ohos.gni")
28} else {
29  ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn"
30  import("$build_root/ark.gni")
31}
32ark_root = "//arkcompiler/runtime_core"
33js_root = "//arkcompiler/ets_runtime"
34global_root = "//base/global/i18n"
35hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits"
36compile_llvm_online = false
37run_with_asan = false
38enable_leak_check = false
39enable_cow_array = true
40enable_coverage = false
41enable_asm_assert = false
42ark_compile_mode = "debug"
43if (defined(is_arkui_x) && is_arkui_x && defined(runtime_mode) &&
44    runtime_mode == "release") {
45  ark_compile_mode = "release"
46}
47
48asan_lib_path = "/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux"
49
50# under /system/lib64 dir
51arkcompiler_relative_lib_path = "module/arkcompiler"
52if (is_standard_system || ark_standalone_build) {
53  icu_part_name = "icu"
54  icu_subsystem_name = "thirdparty"
55} else {
56  icu_part_name = "i18n"
57  icu_subsystem_name = "global"
58}
59
60if (defined(is_arkui_x) && is_arkui_x && target_os == "ios") {
61  sdk_libc_secshared_dep =
62      "$ark_third_party_root/bounds_checking_function:libsec_static"
63} else {
64  sdk_libc_secshared_dep =
65      "$ark_third_party_root/bounds_checking_function:libsec_shared"
66}
67sdk_libc_secshared_config =
68    "$ark_third_party_root/bounds_checking_function:libsec_public_config"
69
70# ohos device, windows previewer, mac previewer
71enable_hilog = !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) &&
72               (is_ohos || is_mingw || is_mac)
73enable_dump_in_faultlog =
74    !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
75    is_standard_system
76enable_bytrace =
77    !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
78    is_standard_system
79enable_hitrace =
80    !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
81    is_standard_system
82
83hiviewdfx_deps = []
84hiviewdfx_ext_deps = []
85if (enable_dump_in_faultlog) {
86  hiviewdfx_ext_deps += [ "faultloggerd:libfaultloggerd" ]
87}
88if (enable_bytrace) {
89  hiviewdfx_ext_deps += [ "hitrace:hitrace_meter" ]
90}
91if (enable_hitrace) {
92  hiviewdfx_ext_deps += [ "hitrace:libhitracechain" ]
93}
94if (enable_hilog) {
95  if (is_mingw) {
96    hiviewdfx_deps += [ "$hilog_root:libhilog_windows" ]
97  } else if (is_mac) {
98    hiviewdfx_deps += [ "$hilog_root:libhilog_mac" ]
99  } else if (is_ohos) {
100    hiviewdfx_ext_deps += [ "hilog:libhilog" ]
101  }
102}
103
104enable_target_compilation =
105    !ark_standalone_build && !is_mac && !(defined(is_arkui_x) && is_arkui_x) &&
106    current_cpu == "arm64"
107
108have_local_code_sign = false
109if (defined(global_parts_info) &&
110    defined(global_parts_info.security_code_signature) &&
111    global_parts_info.security_code_signature) {
112  have_local_code_sign = true
113}
114enable_local_code_sign = false
115if (have_local_code_sign && enable_target_compilation) {
116  enable_local_code_sign = true
117}
118