# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//arkcompiler/runtime_core/static_core/ark_config.gni") action("cross_values_generate") { arch = "" if (current_cpu == "arm") { arch = "AARCH32" } else if (current_cpu == "arm64") { arch = "AARCH64" } else if (current_cpu == "amd64" || current_cpu == "x64" || current_cpu == "x86_64") { arch = "X86_64" } script = "$ark_root/cross_values/cross_values_generator.rb" outputs = [ "$target_gen_dir/generated_values/${arch}_values_gen.h" ] args = [ rebase_path( "$target_gen_dir/../runtime/asm_defines/generated/libasm_defines.S", root_build_dir), rebase_path(outputs[0], root_build_dir), "$arch", ] deps = [ "$ark_root/runtime/asm_defines:asm_defines" ] } asm_defines_def_cpp_content = read_file("$ark_root/runtime/asm_defines/asm_defines.def", "list lines") write_file("$target_gen_dir/asm_defines_def.cpp", asm_defines_def_cpp_content) source_set("asm_defines_def_cpp_gen") { sources = [ "$target_gen_dir/asm_defines_def.cpp" ] configs += [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", "$ark_root/runtime:arkruntime_public_config", ] include_dirs = [ "$ark_root/compiler", "$ark_root/compiler/code_info", "$ark_root/compiler/optimizer/ir", get_label_info( "$ark_root/cross_values:cross_values_getters_generate(${default_toolchain})", "target_gen_dir"), get_label_info("$ark_root/runtime:plugins_defines_h(${default_toolchain})", "target_gen_dir") + "/asm_defines/generated", ] deps = [ "$ark_root/runtime:arkruntime_header_deps" ] cflags_cc = [ "-E", "-P", ] } action("cross_values_getters_generate") { script = "$ark_root/cross_values/cross_values_getters_generator.rb" outputs = [ "$target_gen_dir/cross_values.h" ] preprocessed_defines = get_path_info("$target_gen_dir/asm_defines_def.cpp", "out_dir") + "/asm_defines_def_cpp_gen/asm_defines_def.o" args = [ rebase_path(preprocessed_defines, root_build_dir), rebase_path("$target_gen_dir/generated_values", root_build_dir), rebase_path(outputs[0], root_build_dir), ] deps = [ ":asm_defines_def_cpp_gen", ":cross_values_generate", ] }