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 14project(aotdump) 15 16set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVIXL_INCLUDE_SIMULATOR_AARCH64") 17 18set(GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated) 19file(MAKE_DIRECTORY ${GENERATED_DIR}) 20 21set(AOTDUMP_OPTIONS_H ${GENERATED_DIR}/aotdump_options.h) 22panda_gen_file( 23 DATAFILE ${CMAKE_CURRENT_LIST_DIR}/aotdump.yaml 24 TEMPLATE ${PANDA_ROOT}/templates/options/options.h.erb 25 OUTPUTFILE ${AOTDUMP_OPTIONS_H} 26 REQUIRES ${PANDA_ROOT}/templates/common.rb 27) 28add_custom_target(aotdump_options DEPENDS ${AOTDUMP_OPTIONS_H}) 29 30panda_add_executable(ark_aotdump 31 aotdump.cpp 32) 33 34target_compile_options(ark_aotdump PUBLIC "-Wno-attributes") 35 36panda_add_to_clang_tidy(ark_aotdump) 37add_dependencies(ark_aotdump aotdump_options) 38 39target_link_libraries(ark_aotdump arkbase arkruntime arkaotmanager) 40 41if (PANDA_TARGET_AMD64) 42 add_dependencies(ark_aotdump Zydis) 43 target_link_libraries(ark_aotdump Zydis) 44endif() 45 46target_include_directories(ark_aotdump 47 PUBLIC ${GENERATED_DIR} 48 PUBLIC ${PANDA_ROOT}/compiler/aot 49 PUBLIC ${PANDA_ROOT}/runtime 50) 51 52panda_add_sanitizers(TARGET ark_aotdump SANITIZERS ${PANDA_SANITIZERS_LIST}) 53 54add_check_style(".") 55