mirror of
https://github.com/openharmony/ark_runtime_core.git
synced 2026-07-01 13:17:23 -04:00
e69d39660c
Signed-off-by: songhao <songhonghao@huawei.com>
172 lines
4.5 KiB
Plaintext
172 lines
4.5 KiB
Plaintext
# 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")
|
|
|
|
config("arkassembler_public_config") {
|
|
include_dirs = [
|
|
"$ark_root/assembler",
|
|
"$target_gen_dir",
|
|
"$target_gen_dir/include",
|
|
]
|
|
|
|
defines = [ "PANDA_WITH_ECMASCRIPT" ]
|
|
}
|
|
|
|
libarkassembler_sources = [
|
|
"$target_gen_dir/ins_to_string.cpp",
|
|
"annotation.cpp",
|
|
"assembly-emitter.cpp",
|
|
"assembly-ins.cpp",
|
|
"assembly-parser.cpp",
|
|
"assembly-program.cpp",
|
|
"assembly-type.cpp",
|
|
"context.cpp",
|
|
"extensions/ecmascript/ecmascript_meta.cpp",
|
|
"extensions/extensions.cpp",
|
|
"lexer.cpp",
|
|
"meta.cpp",
|
|
]
|
|
|
|
libarkassembler_configs = [
|
|
sdk_libc_secshared_config,
|
|
"$ark_root:ark_config",
|
|
":arkassembler_public_config",
|
|
"$ark_root/libpandabase:arkbase_public_config",
|
|
"$ark_root/libpandafile:arkfile_public_config",
|
|
]
|
|
|
|
source_set("libarkassembler_static") {
|
|
sources = libarkassembler_sources
|
|
|
|
public_configs = libarkassembler_configs
|
|
|
|
deps = [
|
|
":ark_asm_ecmascript_meta_gen_h",
|
|
":ark_asm_meta_gen_h",
|
|
":isa_gen_libarkassembler_ins_create_api_h",
|
|
":isa_gen_libarkassembler_ins_emit_h",
|
|
":isa_gen_libarkassembler_ins_to_string_cpp",
|
|
":isa_gen_libarkassembler_isa_h",
|
|
":isa_gen_libarkassembler_opcode_parsing_h",
|
|
":isa_gen_libarkassembler_operand_types_print_h",
|
|
"$ark_root/libpandabase:libarkbase",
|
|
"$ark_root/libpandafile:libarkfile",
|
|
sdk_libc_secshared_dep,
|
|
]
|
|
}
|
|
|
|
ohos_shared_library("libarkassembler") {
|
|
deps = [ ":libarkassembler_static" ]
|
|
if (!is_standard_system) {
|
|
relative_install_dir = "ark"
|
|
}
|
|
output_extension = "so"
|
|
if (is_mingw) {
|
|
output_extension = "dll"
|
|
}
|
|
subsystem_name = "ark"
|
|
part_name = "ark"
|
|
}
|
|
|
|
source_set("libarkassembler_frontend_set_static") {
|
|
sources = libarkassembler_sources
|
|
|
|
public_configs = libarkassembler_configs
|
|
|
|
deps = [
|
|
":ark_asm_ecmascript_meta_gen_h",
|
|
":ark_asm_meta_gen_h",
|
|
":isa_gen_libarkassembler_ins_create_api_h",
|
|
":isa_gen_libarkassembler_ins_emit_h",
|
|
":isa_gen_libarkassembler_ins_to_string_cpp",
|
|
":isa_gen_libarkassembler_isa_h",
|
|
":isa_gen_libarkassembler_opcode_parsing_h",
|
|
":isa_gen_libarkassembler_operand_types_print_h",
|
|
"$ark_root/libpandabase:libarkbase_frontend_static",
|
|
"$ark_root/libpandafile:libarkfile_frontend_static",
|
|
sdk_libc_secshared_dep,
|
|
]
|
|
}
|
|
|
|
ohos_static_library("libarkassembler_frontend_static") {
|
|
deps = [ ":libarkassembler_frontend_set_static" ]
|
|
|
|
subsystem_name = "ark"
|
|
part_name = "ark"
|
|
}
|
|
|
|
source_set("ark_asm_static") {
|
|
sources = [ "pandasm.cpp" ]
|
|
|
|
include_dirs = [ "$target_gen_dir" ]
|
|
|
|
public_configs = [
|
|
sdk_libc_secshared_config,
|
|
":arkassembler_public_config",
|
|
"$ark_root:ark_config",
|
|
"$ark_root/libpandabase:arkbase_public_config",
|
|
"$ark_root/libpandafile:arkfile_public_config",
|
|
"$ark_root/runtime:arkruntime_public_config",
|
|
]
|
|
|
|
deps = [
|
|
":libarkassembler_frontend_static",
|
|
"$ark_root/libpandabase:libarkbase_frontend_static",
|
|
"$ark_root/libpandafile:libarkfile_frontend_static",
|
|
]
|
|
|
|
if (!is_mac && !is_mingw && !ark_standalone_build) {
|
|
ldflags = [ "-static-libstdc++" ]
|
|
}
|
|
}
|
|
|
|
ohos_executable("ark_asm") {
|
|
deps = [ ":ark_asm_static" ]
|
|
|
|
install_enable = true
|
|
subsystem_name = "ark"
|
|
}
|
|
|
|
ark_isa_gen("isa_gen_libarkassembler") {
|
|
template_files = [
|
|
"isa.h.erb",
|
|
"ins_emit.h.erb",
|
|
"ins_to_string.cpp.erb",
|
|
"ins_create_api.h.erb",
|
|
"opcode_parsing.h.erb",
|
|
"operand_types_print.h.erb",
|
|
]
|
|
sources = "templates"
|
|
destination = "$target_gen_dir"
|
|
requires = [
|
|
"asm_isapi.rb",
|
|
"../libpandafile/pandafile_isapi.rb",
|
|
]
|
|
}
|
|
|
|
ark_gen_file("ark_asm_meta_gen_h") {
|
|
template_file = "templates/meta_gen.cpp.erb"
|
|
data_file = "metadata.yaml"
|
|
requires = [ "asm_metadata.rb" ]
|
|
output_file = "$target_gen_dir/meta_gen.h"
|
|
}
|
|
|
|
ark_gen_file("ark_asm_ecmascript_meta_gen_h") {
|
|
template_file = "templates/meta_gen.cpp.erb"
|
|
data_file = "extensions/ecmascript/metadata.yaml"
|
|
requires = [ "asm_metadata.rb" ]
|
|
output_file = "$target_gen_dir/ecmascript_meta_gen.h"
|
|
}
|