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
|
|
|
|
}
|
|
|
|
|
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"
|
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-03-09 09:53:59 +00:00
|
|
|
enable_bytrace = true
|
2022-06-25 08:10:35 +00:00
|
|
|
enable_hitrace = true
|
2022-07-06 06:12:54 +00:00
|
|
|
enable_hilog = true
|
2022-05-21 06:28:29 +00:00
|
|
|
enable_dump_in_faultlog = true
|
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"
|
2021-10-12 03:50:58 +00:00
|
|
|
asan_lib_path = "/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux"
|
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-02-22 07:17:34 +00:00
|
|
|
is_cross_platform_build =
|
|
|
|
defined(build_cross_platform_version) && build_cross_platform_version
|
|
|
|
if (is_cross_platform_build && target_os == "ios") {
|
|
|
|
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
|
|
|
|
|
|
|
# Generate file for a template and YAML data provided.
|
|
|
|
#
|
|
|
|
# Mandatory arguments:
|
|
|
|
# data_file -- YAML data full name
|
|
|
|
# template_file -- template full name
|
|
|
|
# output_file -- output file full name
|
|
|
|
# requires -- a list of scripts that provide data-querying API for templates
|
|
|
|
# extra_dependencies -- a list of files that should be considered as dependencies, must be lable
|
|
|
|
template("ark_gen_file") {
|
|
|
|
assert(defined(invoker.data_file), "data_file is required!")
|
|
|
|
assert(defined(invoker.template_file), "template_file is required!")
|
|
|
|
assert(defined(invoker.output_file), "output_file is required!")
|
|
|
|
|
|
|
|
requires = ""
|
|
|
|
if (defined(invoker.requires)) {
|
|
|
|
requires = string_join(",", rebase_path(invoker.requires, root_build_dir))
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_dependencies = []
|
|
|
|
if (defined(invoker.extra_dependencies)) {
|
|
|
|
extra_dependencies += invoker.extra_dependencies
|
|
|
|
}
|
|
|
|
|
|
|
|
action("$target_name") {
|
|
|
|
script = "$ark_root/isa/gen.rb"
|
|
|
|
|
|
|
|
# rerun action when data file or template file update
|
|
|
|
inputs = [
|
|
|
|
invoker.template_file,
|
|
|
|
invoker.data_file,
|
|
|
|
]
|
|
|
|
outputs = [ invoker.output_file ]
|
|
|
|
args = [
|
|
|
|
"--template",
|
|
|
|
rebase_path(invoker.template_file, root_build_dir),
|
|
|
|
"--data",
|
|
|
|
rebase_path(invoker.data_file, root_build_dir),
|
|
|
|
"--require",
|
|
|
|
requires,
|
|
|
|
"--output",
|
|
|
|
rebase_path(outputs[0]),
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = extra_dependencies
|
|
|
|
}
|
|
|
|
}
|