Files
ark_runtime_core/disassembler/BUILD.gn
T
2022-03-14 10:48:57 +08:00

135 lines
3.8 KiB
Plaintext

# Copyright (c) 2021 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("arkdisassembler_public_config") {
defines = [ "PANDA_WITH_ECMASCRIPT" ]
}
arkdisassembler_sources = [
"$target_gen_dir/bc_ins_to_pandasm_ins.cpp",
"$target_gen_dir/get_ins_info.cpp",
"$target_gen_dir/opcode_translator.cpp",
"$target_gen_dir/type_to_pandasm_type.cpp",
"disassembler.cpp",
]
arkdisassembler_configs = [
sdk_libc_secshared_config,
":arkdisassembler_public_config",
"$ark_root:ark_config",
"$ark_root/libpandabase:arkbase_public_config",
"$ark_root/assembler:arkassembler_public_config",
"$ark_root/libpandafile:arkfile_public_config",
]
ohos_shared_library("arkdisassembler") {
sources = arkdisassembler_sources
include_dirs = [ "$ark_root/disassembler" ]
configs = arkdisassembler_configs
deps = [
":isa_gen_ark_disam_bc_ins_to_pandasm_ins_cpp",
":isa_gen_ark_disam_get_ins_info_cpp",
":isa_gen_ark_disam_opcode_translator_cpp",
":type_to_pandasm_type_cpp",
"$ark_root/assembler:libarkassembler",
"$ark_root/libpandabase:libarkbase",
"$ark_root/libpandafile:libarkfile",
sdk_libc_secshared_dep,
]
if (!is_standard_system) {
relative_install_dir = "ark"
}
output_extension = "so"
subsystem_name = "ark"
part_name = "ark"
}
ohos_static_library("arkdisassembler_frontend_static") {
sources = arkdisassembler_sources
include_dirs = [ "$ark_root/disassembler" ]
configs = arkdisassembler_configs
deps = [
":isa_gen_ark_disam_bc_ins_to_pandasm_ins_cpp",
":isa_gen_ark_disam_get_ins_info_cpp",
":isa_gen_ark_disam_opcode_translator_cpp",
":type_to_pandasm_type_cpp",
"$ark_root/assembler:libarkassembler_frontend_static",
"$ark_root/libpandabase:libarkbase_frontend_static",
"$ark_root/libpandafile:libarkfile_frontend_static",
sdk_libc_secshared_dep,
]
subsystem_name = "ark"
part_name = "ark"
}
ohos_executable("ark_disasm") {
sources = [ "disasm.cpp" ]
include_dirs = [ "$target_gen_dir" ]
configs = [
sdk_libc_secshared_config,
"$ark_root:ark_config",
"$ark_root/assembler:arkassembler_public_config",
"$ark_root/libpandabase:arkbase_public_config",
"$ark_root/libpandafile:arkfile_public_config",
]
deps = [
":arkdisassembler_frontend_static",
"$ark_root/assembler: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++" ]
}
install_enable = true
subsystem_name = "ark"
part_name = "ark"
}
ark_isa_gen("isa_gen_ark_disam") {
template_files = [
"opcode_translator.cpp.erb",
"bc_ins_to_pandasm_ins.cpp.erb",
"get_ins_info.cpp.erb",
]
sources = "templates"
destination = "$target_gen_dir"
requires = [
"$ark_root//assembler/asm_isapi.rb",
"$ark_root//libpandafile/pandafile_isapi.rb",
]
}
ark_gen_file("type_to_pandasm_type_cpp") {
template_file =
"$ark_root/disassembler/templates/type_to_pandasm_type.cpp.erb"
data_file = "$ark_root/libpandafile/types.yaml"
requires = [ "$ark_root/libpandafile/types.rb" ]
output_file = "$target_gen_dir/type_to_pandasm_type.cpp"
}