加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BUILD.gn 4.85 KB
一键复制 编辑 原始数据 按行查看 历史
udav 提交于 2023-10-12 10:38 . Format gn files using "gn format" command
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# 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.
import("//ark/runtime_core/ark_config.gni")
import("//build/ohos.gni")
group("ark_packages") {
deps = [ "$ark_es2panda_root/aot:es2panda" ]
}
group("ark_host_linux_tools_packages") {
}
group("ark_host_windows_tools_packages") {
}
group("ark_host_mac_tools_packages") {
}
config("ark_config") {
defines = [ "PANDA_WITH_ECMASCRIPT" ]
# More precisely, this belongs to config("compiler") but it is not handled by
# plugins.gni yet (to handle such configs in a uniform way, we should also add
# empty configs to all other plugins). Alternatively, introduce a boolean
# variable similarly to enable_bytecode_optimizer, or do the other way around
# i.e. add config("bytecodeopt").
defines += [ "ARK_INTRINSIC_SET" ]
}
config("assembler") {
include_dirs = [
"$ark_root/plugins/ecmascript/assembler/extension",
"$target_gen_dir",
]
}
group("assembler_deps") {
deps = [ ":ark_asm_ecmascript_meta_gen_h" ]
}
ark_gen_file("ark_asm_ecmascript_meta_gen_h") {
template_file = "$ark_root/assembler/templates/meta_gen.cpp.erb"
data_file = "$ark_root/plugins/ecmascript/assembler/extension/metadata.yaml"
requires = [ "$ark_root/assembler/asm_metadata.rb" ]
output_file = "$target_gen_dir/ecmascript_meta_gen.h"
}
config("runtime") {
include_dirs = [
"$ark_root/plugins/ecmascript/runtime/",
"$target_gen_dir",
"$ark_root_gen_dir",
]
configs = [
"$ark_es2panda_root:libes2panda_public_config",
"$ark_root/assembler:arkassembler_public_config",
"$ark_root/libpandafile:arkfile_public_config",
]
}
config("runtime_interpreter_impl") {
# Required, but empty: nothing to add currently
}
ark_asm_gen("ecmastdlib") {
input_file = "ecmastdlib/ecmastdlib.pa"
output_file = "$target_gen_dir/ecmastdlib.abc"
}
action("ecmastdlib_inline_h") {
script = "ecmastdlib/ecmastdlib_inline_gen.rb"
outputs = [ "$target_gen_dir/ecmastdlib_inline_gen.h" ]
stdlib = get_target_outputs(":ecmastdlib")
args = [
"-t",
rebase_path("ecmastdlib/ecmastdlib_inline_gen.h.erb", root_build_dir),
"-o",
rebase_path("$target_gen_dir/ecmastdlib_inline_gen.h"),
"-d",
rebase_path(stdlib[0], root_build_dir),
]
deps = [ ":ecmastdlib" ]
}
ark_gen_file("ecma_intrinsics_gen_arkruntime") {
template_file =
"$ark_root/plugins/ecmascript/runtime/templates/intrinsics_gen.cpp.erb"
data_file = "$ark_root/plugins/ecmascript/runtime/ecma_runtime.yaml"
requires = [
"$ark_root/runtime/templates/intrinsics.rb",
"$ark_root/runtime/templates/runtime.rb",
]
output_file = "$target_gen_dir/intrinsics_gen.cpp"
}
config("bytecodeopt") {
include_dirs = [
"$ark_root/plugins/ecmascript/bytecode_optimizer/",
"$target_gen_dir",
]
}
ark_isa_gen("isa_gen_ecma_bytecodeopt") {
template_files = [ "ecmascript_codegen_intrinsics_gen.inc.erb" ]
sources = "$ark_root/plugins/ecmascript/bytecode_optimizer/templates/"
destination = "$target_gen_dir/"
requires = [ "$ark_root//assembler/asm_isapi.rb" ]
}
config("compiler") {
include_dirs = [
"$ark_root/plugins/ecmascript/compiler/",
"$target_gen_dir",
]
}
ark_isa_gen("isa_gen_ecma_compiler") {
template_files = [ "ecmascript_inst_builder_gen.cpp.erb" ]
sources = "$ark_root/plugins/ecmascript/compiler/templates/"
destination = "$target_gen_dir/"
}
ark_gen("ecma_builtins_gen") {
data = "$ark_root/plugins/ecmascript/runtime/builtins/templates/builtins.yaml"
template_files = [
"builtins_declaration_gen.h.erb",
"builtins_ids_gen.inl.erb",
"builtins_initializers_gen.h.erb",
"builtins_resolve_inlinable_gen.inl.erb",
"builtins_inline_intrinsics_decls_gen.inl.erb",
"builtins_inline_intrinsics_gen.inl.erb",
]
sources = "$ark_root/plugins/ecmascript/runtime/builtins/templates"
destination = "$target_gen_dir/runtime/builtins/generated"
requires = [
"$ark_root/templates/common.rb",
"$ark_root/compiler/optimizer/templates/instructions.rb",
"$ark_root/runtime/templates/intrinsics.rb",
"$ark_root/plugins/ecmascript/runtime/builtins/templates/builtins.rb",
]
extra_dependencies = [ "$ark_root/runtime:arkruntime_gen_intrinsics_yaml" ]
extra_argv = [
rebase_path("$target_gen_dir/../../runtime/intrinsics.yaml",
root_build_dir),
rebase_path("$ark_root/compiler/optimizer/ir/instructions.yaml",
root_build_dir),
]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化