1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//arkcompiler/runtime_core/ark_config.gni") 15import("//build/ohos.gni") 16 17config("aotdump_public_config") { 18 include_dirs = [ 19 "$target_gen_dir/generated", 20 "$ark_root/compiler/aot", 21 "$ark_root/libpandafile", 22 "$ark_root/runtime", 23 ] 24 25 if (current_cpu == "x86") { 26 #TODO deps = [ "asmjit", "Zydis" ] 27 } else if (current_cpu == "amd64" || current_cpu == "x64" || 28 current_cpu == "x86_64") { 29 #target: amd64/x64/x86_64 30 include_dirs += [ 31 "$ark_third_party_root/zydis/include", 32 "$ark_third_party_root/zydis/zycore/include", 33 ] 34 35 #target: aarch64 36 include_dirs += [ 37 "$ark_third_party_root/vixl/src/aarch64", 38 "$ark_third_party_root/vixl/src", 39 ] 40 } else if (current_cpu == "arm") { 41 include_dirs += [ 42 "$ark_root/vixl/src/aarch32", 43 "$ark_root/vixl/src", 44 ] 45 } else if (current_cpu == "arm64") { 46 include_dirs += [ 47 "$ark_third_party_root/vixl/src/aarch64", 48 "$ark_third_party_root/vixl/src", 49 ] 50 } 51} 52 53ark_gen_file("aotdump_options_h") { 54 template_file = "$ark_root/templates/options/options.h.erb" 55 data_file = "aotdump.yaml" 56 requires = [ "$ark_root/templates/common.rb" ] 57 output_file = "$target_gen_dir/generated/aotdump_options.h" 58} 59 60ohos_executable("ark_aotdump") { 61 sources = [ "aotdump.cpp" ] 62 63 configs = [ 64 ":aotdump_public_config", 65 "$ark_root:ark_config", 66 "$ark_root/runtime:arkruntime_public_config", 67 "$ark_root/libpandabase:arkbase_public_config", 68 "$ark_root/libpandafile:arkfile_public_config", 69 "$ark_root/compiler:arkcompiler_public_config", 70 "$ark_root/compiler/optimizer/code_generator:arkencoder_config", 71 "$ark_third_party_root/zydis:zydis_public_config", 72 sdk_libc_secshared_config, 73 ] 74 75 deps = [ 76 ":aotdump_options_h", 77 "$ark_root/compiler:libarkcompiler", 78 "$ark_root/compiler/aot:libarkaotmanager", 79 "$ark_root/compiler/optimizer/code_generator:libarkencoder", 80 "$ark_root/libpandabase:libarkbase", 81 "$ark_root/libpandafile:libarkfile", 82 "$ark_root/runtime:libarkruntime", 83 "$ark_third_party_root/zydis:libZydis", 84 ] 85 86 install_enable = true 87 subsystem_name = "ark_aotdump" 88} 89