2022-08-17 09:00:15 +00:00
|
|
|
# Copyright (c) 2022 Huawei Device Co., Ltd.
|
2021-09-04 08:06:49 +00:00
|
|
|
# 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.
|
|
|
|
|
2022-06-20 09:59:16 +00:00
|
|
|
if (!defined(ark_standalone_build)) {
|
2022-10-24 15:31:14 +00:00
|
|
|
ark_standalone_build = false
|
|
|
|
}
|
|
|
|
|
2023-02-10 07:38:16 +00:00
|
|
|
declare_args() {
|
|
|
|
# If true, use icu to implement Intl APIs.
|
|
|
|
# If false, use @ohos.intl APIs to implement Intl APIs.
|
|
|
|
enable_ark_intl = true
|
2023-10-24 09:29:58 +00:00
|
|
|
run_regress_test = false
|
2023-11-07 08:53:04 +00:00
|
|
|
|
|
|
|
TARGET = "x86_64"
|
|
|
|
HOST_ARCH = 64
|
|
|
|
}
|
|
|
|
|
|
|
|
if (target_cpu == "arm64") {
|
|
|
|
TARGET = "aarch64"
|
2023-02-10 07:38:16 +00:00
|
|
|
}
|
2023-11-10 03:17:56 +00:00
|
|
|
MAPLEALL_ROOT = "//arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple"
|
2023-11-07 08:53:04 +00:00
|
|
|
MAPLEALL_THIRD_PARTY_ROOT = "//third_party"
|
2023-02-10 07:38:16 +00:00
|
|
|
|
2022-10-24 15:31:14 +00:00
|
|
|
if (!ark_standalone_build) {
|
|
|
|
build_root = "//build"
|
|
|
|
ark_third_party_root = "//third_party"
|
|
|
|
import("$build_root/ohos.gni")
|
2022-05-12 13:57:08 +00:00
|
|
|
} else {
|
2022-10-24 15:31:14 +00:00
|
|
|
ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn"
|
2022-08-04 07:37:10 +00:00
|
|
|
import("$build_root/ark.gni")
|
2022-05-12 13:57:08 +00:00
|
|
|
}
|
2022-10-24 15:31:14 +00:00
|
|
|
ark_root = "//arkcompiler/runtime_core"
|
|
|
|
js_root = "//arkcompiler/ets_runtime"
|
2023-02-10 07:38:16 +00:00
|
|
|
global_root = "//base/global/i18n"
|
2023-03-02 02:49:38 +00:00
|
|
|
hilog_root = "//base/hiviewdfx/hilog/interfaces/native/innerkits"
|
2023-10-12 09:01:58 +00:00
|
|
|
qos_root = "//foundation/resourceschedule/qos_manager"
|
2021-09-11 03:05:55 +00:00
|
|
|
compile_llvm_online = false
|
2021-10-12 03:50:58 +00:00
|
|
|
run_with_asan = false
|
2022-08-27 02:03:37 +00:00
|
|
|
enable_leak_check = false
|
2022-10-26 02:39:13 +00:00
|
|
|
enable_cow_array = true
|
2022-10-31 12:31:21 +00:00
|
|
|
enable_coverage = false
|
2022-12-02 03:41:58 +00:00
|
|
|
enable_asm_assert = false
|
2023-02-15 09:17:18 +00:00
|
|
|
ark_compile_mode = "debug"
|
2023-11-03 08:50:37 +00:00
|
|
|
if (defined(is_arkui_x) && is_arkui_x && defined(runtime_mode) &&
|
2023-10-12 09:10:22 +00:00
|
|
|
runtime_mode == "release") {
|
|
|
|
ark_compile_mode = "release"
|
2023-06-14 06:15:02 +00:00
|
|
|
}
|
|
|
|
|
2021-10-12 03:50:58 +00:00
|
|
|
asan_lib_path = "/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux"
|
2023-05-29 08:50:41 +00:00
|
|
|
|
|
|
|
# under /system/lib64 dir
|
|
|
|
arkcompiler_relative_lib_path = "module/arkcompiler"
|
2022-12-14 10:12:25 +00:00
|
|
|
if (is_standard_system || ark_standalone_build) {
|
2022-08-04 07:37:10 +00:00
|
|
|
icu_part_name = "icu"
|
|
|
|
icu_subsystem_name = "thirdparty"
|
|
|
|
} else {
|
|
|
|
icu_part_name = "i18n"
|
|
|
|
icu_subsystem_name = "global"
|
|
|
|
}
|
2021-09-04 08:06:49 +00:00
|
|
|
|
2023-11-03 08:50:37 +00:00
|
|
|
if (defined(is_arkui_x) && is_arkui_x && target_os == "ios") {
|
2023-02-22 07:17:34 +00:00
|
|
|
sdk_libc_secshared_dep =
|
|
|
|
"$ark_third_party_root/bounds_checking_function:libsec_static"
|
|
|
|
} else {
|
|
|
|
sdk_libc_secshared_dep =
|
|
|
|
"$ark_third_party_root/bounds_checking_function:libsec_shared"
|
|
|
|
}
|
2022-03-09 02:42:44 +00:00
|
|
|
sdk_libc_secshared_config =
|
2022-10-24 15:31:14 +00:00
|
|
|
"$ark_third_party_root/bounds_checking_function:libsec_public_config"
|
2021-10-12 03:50:58 +00:00
|
|
|
|
2023-03-18 11:29:35 +00:00
|
|
|
# ohos device, windows previewer, mac previewer
|
2023-11-03 08:50:37 +00:00
|
|
|
enable_hilog = !ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) &&
|
2023-03-18 11:29:35 +00:00
|
|
|
(is_ohos || is_mingw || is_mac)
|
2023-11-03 08:50:37 +00:00
|
|
|
enable_dump_in_faultlog =
|
|
|
|
!ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
|
|
|
|
is_standard_system
|
|
|
|
enable_bytrace =
|
|
|
|
!ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
|
|
|
|
is_standard_system
|
|
|
|
enable_hitrace =
|
|
|
|
!ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
|
|
|
|
is_standard_system
|
2021-10-12 03:50:58 +00:00
|
|
|
|
2023-03-18 11:29:35 +00:00
|
|
|
hiviewdfx_deps = []
|
|
|
|
hiviewdfx_ext_deps = []
|
|
|
|
if (enable_dump_in_faultlog) {
|
|
|
|
hiviewdfx_ext_deps += [ "faultloggerd:libfaultloggerd" ]
|
|
|
|
}
|
|
|
|
if (enable_bytrace) {
|
2023-06-20 06:18:16 +00:00
|
|
|
hiviewdfx_ext_deps += [ "hitrace:hitrace_meter" ]
|
2023-03-18 11:29:35 +00:00
|
|
|
}
|
|
|
|
if (enable_hitrace) {
|
2023-06-20 06:18:16 +00:00
|
|
|
hiviewdfx_ext_deps += [ "hitrace:libhitracechain" ]
|
2023-03-18 11:29:35 +00:00
|
|
|
}
|
|
|
|
if (enable_hilog) {
|
|
|
|
if (is_mingw) {
|
|
|
|
hiviewdfx_deps += [ "$hilog_root:libhilog_windows" ]
|
|
|
|
} else if (is_mac) {
|
|
|
|
hiviewdfx_deps += [ "$hilog_root:libhilog_mac" ]
|
|
|
|
} else if (is_ohos) {
|
2023-06-20 06:18:16 +00:00
|
|
|
hiviewdfx_ext_deps += [ "hilog:libhilog" ]
|
2021-10-12 03:50:58 +00:00
|
|
|
}
|
|
|
|
}
|
2023-05-31 09:59:11 +00:00
|
|
|
|
2023-11-03 08:50:37 +00:00
|
|
|
enable_target_compilation =
|
|
|
|
!ark_standalone_build && !is_mac && !(defined(is_arkui_x) && is_arkui_x) &&
|
|
|
|
current_cpu == "arm64"
|
2023-05-29 14:13:40 +00:00
|
|
|
|
|
|
|
have_local_code_sign = false
|
|
|
|
if (defined(global_parts_info) &&
|
|
|
|
defined(global_parts_info.security_code_signature) &&
|
|
|
|
global_parts_info.security_code_signature) {
|
|
|
|
have_local_code_sign = true
|
|
|
|
}
|
|
|
|
enable_local_code_sign = false
|
|
|
|
if (have_local_code_sign && enable_target_compilation) {
|
|
|
|
enable_local_code_sign = true
|
|
|
|
}
|
2023-09-19 07:38:21 +00:00
|
|
|
|
2023-09-22 05:32:32 +00:00
|
|
|
ets_runtime_output_path = "ets_runtime/ets_runtime"
|