# Copyright (c) 2024 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("//arkcompiler/runtime_core/static_core/ark_config.gni") import("//arkcompiler/runtime_core/static_vm_config.gni") import("$ark_root/plugins/plugins.gni") if (ark_standalone_build) { import("$build_root/ark.gni") } else { import("//build/ohos.gni") } abc2program_sources = [ "$target_gen_dir/abc_inst_convert.cpp", "$target_gen_dir/abc_opcode_convert.cpp", "$target_gen_dir/abc_type_convert.cpp", "abc2program_compiler.cpp", "abc2program_driver.cpp", "abc2program_key_data.cpp", "abc2program_log.cpp", "abc2program_options.cpp", "abc_class_processor.cpp", "abc_code_processor.cpp", "abc_field_processor.cpp", "abc_file_entity_processor.cpp", "abc_file_processor.cpp", "abc_file_utils.cpp", "abc_literal_array_processor.cpp", "abc_method_processor.cpp", "abc_string_table.cpp", "common/abc_code_converter.cpp", "program_dump.cpp", ] abc2program_sources += plugin_abc2program_sources abc2program_configs = [ "$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("arkts_abc2program") { stack_protector_ret = false sources = abc2program_sources include_dirs = [ "$ark_root/abc2program", "$target_gen_dir", ] configs = abc2program_configs deps = [ ":abc2program_plugins_inc", ":abc_type_convert_cpp", ":get_language_specific_metadata_inc", ":isa_gen_abc2program_abc_inst_convert_cpp", ":isa_gen_abc2program_abc_opcode_convert_cpp", "$ark_root/assembler:libarktsassembler_frontend_static", "$ark_root/libpandafile:libarktsfile_frontend_static", ] external_deps = [ sdk_libc_secshared_dep ] if (is_mingw) { deps += [ "$ark_root/libpandabase:libarktsbase" ] } else { deps += [ "$ark_root/libpandabase:libarktsbase_frontend_static" ] } if (!is_standard_system) { relative_install_dir = "ark" } output_extension = "so" if (is_mingw) { output_extension = "dll" } part_name = "runtime_core" subsystem_name = "arkcompiler" } ohos_static_library("arkts_abc2program_frontend_static") { sources = abc2program_sources include_dirs = [ "$ark_root/abc2program", "$target_gen_dir", ] configs = abc2program_configs external_deps = [ sdk_libc_secshared_dep ] deps = [ ":abc2program_plugins_inc", ":abc_type_convert_cpp", ":get_language_specific_metadata_inc", ":isa_gen_abc2program_abc_inst_convert_cpp", ":isa_gen_abc2program_abc_opcode_convert_cpp", "$ark_root/assembler:libarktsassembler_frontend_static", "$ark_root/libpandabase:libarktsbase_frontend_static", "$ark_root/libpandafile:libarktsfile_frontend_static", ] part_name = "runtime_core" subsystem_name = "arkcompiler" } ohos_executable("arkts_abc2prog") { sources = [ "abc2prog_main.cpp" ] include_dirs = [ "$target_gen_dir", "$root_gen_dir/libpandabase", ] configs = [ "$ark_root:ark_config", "$ark_root/assembler:arkassembler_public_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", ] deps = [ ":arkts_abc2program_frontend_static", "$ark_root/assembler:libarktsassembler_frontend_static", "$ark_root/libpandabase:libarktsbase_frontend_static", "$ark_root/libpandafile:libarktsfile_frontend_static", ] libs = platform_libs if (!is_mac && !is_mingw) { ldflags = platform_ldflags } install_enable = false part_name = "runtime_core" subsystem_name = "arkcompiler" } ark_isa_gen("isa_gen_abc2program") { template_files = [ "abc_opcode_convert.cpp.erb", "abc_inst_convert.cpp.erb", ] sources = "templates" destination = "$target_gen_dir" requires = [ "$ark_root//assembler/asm_isapi.rb", "$ark_root//libpandafile/pandafile_isapi.rb", ] } ark_gen_file("abc_type_convert_cpp") { template_file = "$ark_root/abc2program/templates/abc_type_convert.cpp.erb" data = [ "$ark_root/libpandafile/types.yaml" ] api = [ "$ark_root/libpandafile/types.rb" ] output_file = "$target_gen_dir/abc_type_convert.cpp" } ark_gen_file("abc2program_plugins_inc") { extra_dependencies = [ "$ark_root:concat_plugins_yamls" ] template_file = "templates/abc2program_plugins.inc.erb" data = [ ark_plugin_options_yaml ] api = [ "$ark_root/templates/plugin_options.rb" ] output_file = "$target_gen_dir/abc2program_plugins.inc" } ark_gen_file("get_language_specific_metadata_inc") { extra_dependencies = [ "$ark_root:concat_plugins_yamls" ] template_file = "templates/get_language_specific_metadata.inc.erb" data = [ ark_plugin_options_yaml ] api = [ "$ark_root/templates/plugin_options.rb" ] output_file = "$target_gen_dir/get_language_specific_metadata.inc" }