# 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/ark_config.gni") config("abc2program_public_config") { defines = [ "PANDA_WITH_ECMASCRIPT" ] } abc2program_sources = [ "$target_gen_dir/abc_inst_convert.cpp", "$target_gen_dir/abc_opcode_convert.cpp", "$target_gen_dir/abc_type_convert.cpp", "$target_gen_dir/program_dump_utils.cpp", "abc2program_compiler.cpp", "abc2program_driver.cpp", "abc2program_log.cpp", "abc2program_options.cpp", "abc_annotation_processor.cpp", "abc_class_processor.cpp", "abc_code_processor.cpp", "abc_field_processor.cpp", "abc_file_entity_processor.cpp", "abc_literal_array_processor.cpp", "abc_method_processor.cpp", "abc_module_array_processor.cpp", "common/abc2program_entity_container.cpp", "common/abc_code_converter.cpp", "common/abc_file_utils.cpp", "dump_utils.cpp", "program_dump.cpp", ] abc2program_configs = [ ":abc2program_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("abc2program") { stack_protector_ret = false sources = abc2program_sources include_dirs = [ "$ark_root/abc2program", "$target_gen_dir", ] configs = abc2program_configs deps = [ ":abc_type_convert_cpp", ":isa_gen_abc2program_abc_inst_convert_cpp", ":isa_gen_abc2program_abc_opcode_convert_cpp", ":isa_gen_abc2program_program_dump_utils_cpp", "$ark_root/assembler:libarkassembler", ] external_deps = [ sdk_libc_secshared_dep ] if (enable_hilog && defined(ohos_indep_compiler_enable) && ohos_indep_compiler_enable) { external_deps += [ "hilog:libhilog" ] } if (!is_standard_system) { relative_install_dir = "ark" } output_extension = "so" if (is_mingw) { output_extension = "dll" } cflags = [ "-Wno-c++20-designator" ] part_name = "runtime_core" subsystem_name = "arkcompiler" } ohos_static_library("abc2program_frontend_static") { stack_protector_ret = false sources = abc2program_sources include_dirs = [ "$ark_root/abc2program", "$target_gen_dir", ] configs = abc2program_configs deps = [ ":abc_type_convert_cpp", ":isa_gen_abc2program_abc_inst_convert_cpp", ":isa_gen_abc2program_abc_opcode_convert_cpp", ":isa_gen_abc2program_program_dump_utils_cpp", "$ark_root/assembler:libarkassembler_frontend_static", "$ark_root/libpandabase:libarkbase_frontend_static", "$ark_root/libpandafile:libarkfile_frontend_static", ] if (is_arkui_x) { deps += [ "$ark_third_party_root/bounds_checking_function:libsec_static" ] } else { external_deps = [ "bounds_checking_function:libsec_static" ] if (enable_hilog && defined(ohos_indep_compiler_enable) && ohos_indep_compiler_enable) { external_deps += [ "hilog:libhilog" ] } } cflags = [ "-Wno-c++20-designator" ] part_name = "runtime_core" subsystem_name = "arkcompiler" } ohos_executable("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 = [ ":abc2program_frontend_static", "$ark_root/assembler:libarkassembler_frontend_static", "$ark_root/libpandabase:libarkbase_frontend_static", "$ark_root/libpandafile:libarkfile_frontend_static", ] external_deps = [ sdk_libc_secshared_dep ] 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", "program_dump_utils.cpp.erb", ] sources = "common" 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/common/abc_type_convert.cpp.erb" data_file = "$ark_root/libpandafile/types.yaml" requires = [ "$ark_root/libpandafile/types.rb" ] output_file = "$target_gen_dir/abc_type_convert.cpp" }