# Copyright (c) 2025 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("//build/ohos.gni") if (is_mac) { dylib_suffix = ".dylib" } else if (is_linux) { dylib_suffix = ".so" } else { dylib_suffix = ".dll" } common_bin = [ { label = "../tooling/hybrid_step:arkhybridstep" subsystem_name = "arkcompiler" part_name = "toolchain" lib_names = [ "arkhybridstep" ] } ] not_needed("*", [ "dylib_suffix" ]) # All dynamic libraries to be copied to the path "/bin/", # which are related to the previewer, can be added to this script. ohos_copy("copy_simulator_debug") { deps = [] sources = [] foreach(item, common_bin) { subsystem_name = item.subsystem_name part_name = item.part_name deps += [ item.label ] out_path = get_label_info(item.label, "root_out_dir") lib_names = [] if (defined(item.lib_names)) { lib_names += item.lib_names } else { lib_names += [ string_replace(get_label_info(item.label, "name"), "lib", "", 1) ] } foreach(lib_name, lib_names) { sources += [ "${out_path}/${subsystem_name}/${part_name}/lib${lib_name}${dylib_suffix}" ] } } outputs = [ target_out_dir + "/bin/{{source_file_part}}" ] module_source_dir = target_out_dir + "/bin" module_install_name = "" } # All dynamic libraries to be copied to the path "/previewer/common/bin/", # which are related to the previewer, can be added to this script. ohos_copy("copy_previewer_debug") { deps = [] sources = [] foreach(item, common_bin) { subsystem_name = item.subsystem_name part_name = item.part_name deps += [ item.label ] out_path = get_label_info(item.label, "root_out_dir") lib_names = [] if (defined(item.lib_names)) { lib_names += item.lib_names } else { lib_names += [ string_replace(get_label_info(item.label, "name"), "lib", "", 1) ] } foreach(lib_name, lib_names) { sources += [ "${out_path}/${subsystem_name}/${part_name}/lib${lib_name}${dylib_suffix}" ] } } # Set the output directory for all dynamic libraries. outputs = [ target_out_dir + "/previewer/common/bin/{{source_file_part}}" ] module_source_dir = target_out_dir + "/previewer/common/bin/" module_install_name = "" }