# 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("//arkcompiler/runtime_core/ark_config.gni") import("//build/ohos.gni") config("aotdump_public_config") { include_dirs = [ "$target_gen_dir/generated", "$ark_root/compiler/aot", "$ark_root/libpandafile", "$ark_root/runtime", ] if (current_cpu == "x86") { #TODO deps = [ "asmjit", "Zydis" ] } else if (current_cpu == "amd64" || current_cpu == "x64" || current_cpu == "x86_64") { #target: amd64/x64/x86_64 include_dirs += [ "$ark_third_party_root/zydis/include", "$ark_third_party_root/zydis/zycore/include", ] #target: aarch64 include_dirs += [ "$ark_third_party_root/vixl/src/aarch64", "$ark_third_party_root/vixl/src", ] } else if (current_cpu == "arm") { include_dirs += [ "$ark_root/vixl/src/aarch32", "$ark_root/vixl/src", ] } else if (current_cpu == "arm64") { include_dirs += [ "$ark_third_party_root/vixl/src/aarch64", "$ark_third_party_root/vixl/src", ] } } ark_gen_file("aotdump_options_h") { template_file = "$ark_root/templates/options/options.h.erb" data_file = "aotdump.yaml" requires = [ "$ark_root/templates/common.rb" ] output_file = "$target_gen_dir/generated/aotdump_options.h" } ohos_executable("ark_aotdump") { sources = [ "aotdump.cpp" ] configs = [ ":aotdump_public_config", "$ark_root:ark_config", "$ark_root/runtime:arkruntime_public_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", "$ark_root/compiler:arkcompiler_public_config", "$ark_root/compiler/optimizer/code_generator:arkencoder_config", "$ark_third_party_root/zydis:zydis_public_config", sdk_libc_secshared_config, ] deps = [ ":aotdump_options_h", "$ark_root/compiler:libarkcompiler", "$ark_root/compiler/aot:libarkaotmanager", "$ark_root/compiler/optimizer/code_generator:libarkencoder", "$ark_root/libpandabase:libarkbase", "$ark_root/libpandafile:libarkfile", "$ark_root/runtime:libarkruntime", "$ark_third_party_root/zydis:libZydis", ] install_enable = true subsystem_name = "ark_aotdump" }