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 14set(EXTENSION_DIR ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/assembler/extension) 15 16target_sources(arkassembler PRIVATE ${EXTENSION_DIR}/ecmascript_meta.cpp) 17target_include_directories(arkassembler PUBLIC ${EXTENSION_DIR}) 18 19set(ECMASCRIPT_META_GEN_H ${PANDA_BINARY_ROOT}/assembler/ecmascript_meta_gen.h) 20panda_gen_file( 21 DATAFILE ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/assembler/extension/metadata.yaml 22 TEMPLATE ${PANDA_ROOT}/assembler/templates/meta_gen.cpp.erb 23 OUTPUTFILE ${ECMASCRIPT_META_GEN_H} 24 REQUIRES ${PANDA_ROOT}/assembler/asm_metadata.rb 25) 26add_custom_target(ecmascript_meta_gen_h DEPENDS ${ECMASCRIPT_META_GEN_H}) 27add_dependencies(arkassembler ecmascript_meta_gen_h) 28 29if (PANDA_ENABLE_AFL) 30 target_sources(arkassembler_fuzz PRIVATE ${EXTENSION_DIR}/ecmascript_meta.cpp) 31 target_include_directories(arkassembler_fuzz PUBLIC ${EXTENSION_DIR}) 32 add_dependencies(arkassembler_fuzz ecmascript_meta_gen_h) 33endif() 34