• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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
14import("//build/ohos.gni")
15if (is_mac) {
16  dylib_suffix = ".dylib"
17} else if (is_linux) {
18  dylib_suffix = ".so"
19} else {
20  dylib_suffix = ".dll"
21}
22
23common_bin = [
24  {
25    label = "../tooling/hybrid_step:arkhybridstep"
26    subsystem_name = "arkcompiler"
27    part_name = "toolchain"
28    lib_names = [ "arkhybridstep" ]
29  }
30]
31
32not_needed("*", [ "dylib_suffix" ])
33# All dynamic libraries to be copied to the path "/bin/",
34# which are related to the previewer, can be added to this script.
35ohos_copy("copy_simulator_debug") {
36  deps = []
37  sources = []
38  foreach(item, common_bin) {
39    subsystem_name = item.subsystem_name
40    part_name = item.part_name
41    deps += [ item.label ]
42    out_path = get_label_info(item.label, "root_out_dir")
43    lib_names = []
44    if (defined(item.lib_names)) {
45      lib_names += item.lib_names
46    } else {
47      lib_names +=
48          [ string_replace(get_label_info(item.label, "name"), "lib", "", 1) ]
49    }
50    foreach(lib_name, lib_names) {
51      sources += [ "${out_path}/${subsystem_name}/${part_name}/lib${lib_name}${dylib_suffix}" ]
52    }
53  }
54
55  outputs = [ target_out_dir + "/bin/{{source_file_part}}" ]
56  module_source_dir = target_out_dir + "/bin"
57  module_install_name = ""
58}
59
60
61# All dynamic libraries to be copied to the path "/previewer/common/bin/",
62# which are related to the previewer, can be added to this script.
63ohos_copy("copy_previewer_debug") {
64  deps = []
65  sources = []
66  foreach(item, common_bin) {
67    subsystem_name = item.subsystem_name
68    part_name = item.part_name
69    deps += [ item.label ]
70    out_path = get_label_info(item.label, "root_out_dir")
71    lib_names = []
72    if (defined(item.lib_names)) {
73      lib_names += item.lib_names
74    } else {
75      lib_names +=
76          [ string_replace(get_label_info(item.label, "name"), "lib", "", 1) ]
77    }
78    foreach(lib_name, lib_names) {
79      sources += [ "${out_path}/${subsystem_name}/${part_name}/lib${lib_name}${dylib_suffix}" ]
80    }
81  }
82
83  # Set the output directory for all dynamic libraries.
84  outputs = [ target_out_dir + "/previewer/common/bin/{{source_file_part}}" ]
85  module_source_dir = target_out_dir + "/previewer/common/bin/"
86  module_install_name = ""
87}
88