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(ISA_FILE "${CMAKE_BINARY_DIR}/isa/isa.yaml") 15set(ISA_CORE_FILE "${PROJECT_SOURCE_DIR}/isa/isa.yaml") 16set(ISA_COMBINE "${PROJECT_SOURCE_DIR}/isa/combine.rb") 17set(ISA_PLUGIN_FILES "") 18 19get_target_property(ISA_PLUGIN_FILES isa_combine ISA_PLUGIN_FILES) 20 21string(REPLACE ";" "," ISA_PLUGIN_FILES_STR "${ISA_PLUGIN_FILES}") 22 23# ISA combine 24add_custom_command(OUTPUT ${ISA_FILE} 25 COMMENT "Combine ISA files" 26 COMMAND ${ISA_COMBINE} -d "${ISA_CORE_FILE},${ISA_PLUGIN_FILES_STR}" -o ${ISA_FILE} 27 DEPENDS ${ISA_COMBINE} ${ISA_CORE_FILE} ${ISA_PLUGIN_FILES} 28) 29add_custom_target(isa_plugin_gen DEPENDS ${ISA_FILE}) 30add_dependencies(isa_combine isa_plugin_gen) 31