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 14 import("//arkcompiler/runtime_core/ark_config.gni") 15 16 isa_paths = [ rebase_path("$ark_root/isa/isa.yaml", root_build_dir) ] 17 18 foreach(plugin, enabled_plugins) { 19 print("add isa plugin: $plugin") 20 plugin_dir = "$ark_root/plugins/$plugin" 21 22 source_files = read_file("$plugin_dir/subproject_sources.gn", "scope") 23 if (defined(source_files.srcs_isa_path)) { 24 source_file = "$plugin_dir/${source_files.srcs_isa_path}" 25 src_scope = read_file(source_file, "scope") 26 27 if (defined(src_scope.srcs)) { 28 foreach(src, src_scope.srcs) { 29 isa_paths += [ rebase_path("$ark_root/$src", root_build_dir) ] 30 } 31 } 32 } 33 34 source_files = { 35 } 36 src_scope = { 37 } 38 } 39 40 action("isa_combine") { 41 script = "$ark_root/isa/combine.rb" 42 input_args = string_join(",", isa_paths) 43 inputs = [ "$ark_root/isa/isa.yaml" ] 44 outputs = [ "$root_gen_dir/isa/isa.yaml" ] 45 args = [ 46 "-d", 47 "$input_args", 48 "-o", 49 rebase_path(outputs[0], root_build_dir), 50 ] 51 } 52