• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14import("//arkcompiler/runtime_core/static_core/ark_config.gni")
15import("//build/ohos.gni")
16import("$ark_root/plugins/plugins.gni")
17
18config("arklinker_public_config") {
19  include_dirs = [
20    "$ark_root/libpandabase",
21    "$ark_root/libpandafile",
22  ]
23}
24
25arklinker_sources = [
26  "linker.cpp",
27  "linker_code_parser_context.cpp",
28  "linker_context.cpp",
29  "linker_context_misc.cpp",
30]
31
32arklinker_configs = [
33  sdk_libc_secshared_config,
34  "$ark_root:ark_config",
35  "$ark_root/libpandabase:arkbase_public_config",
36  "$ark_root/libpandafile:arkfile_public_config",
37]
38
39ohos_shared_library("arklinker") {
40  sources = arklinker_sources
41
42  include_dirs = [
43    "$ark_root/libpandabase",
44    "$ark_root/libpandafile",
45    "$target_gen_dir",
46  ]
47
48  configs = arklinker_configs
49
50  deps = [
51    "$ark_root/libpandabase:libarktsbase",
52    "$ark_root/libpandafile:libarktsfile",
53    sdk_libc_secshared_dep,
54  ]
55
56  output_extension = "so"
57  if (is_mingw) {
58    output_extension = "dll"
59  }
60  part_name = ark_part_name
61  subsystem_name = "$ark_subsystem_name"
62}
63
64ark_gen_file("link_options_h") {
65  template_file = "$ark_root/templates/options/options.h.erb"
66  data_file = "options.yaml"
67  requires = [ "$ark_root/templates/common.rb" ]
68  output_file = "$target_gen_dir/panda_gen_options/generated/link_options.h"
69}
70
71ohos_executable("ark_link") {
72  sources = [ "link.cpp" ]
73
74  include_dirs = [
75    "$target_gen_dir",
76    "$target_gen_dir/panda_gen_options",
77    "$ark_root_gen_dir/libpandabase",
78  ]
79
80  configs = [
81    sdk_libc_secshared_config,
82    "$ark_root:ark_config",
83    "$ark_root/static_linker:arklinker_public_config",
84    "$ark_root/libpandabase:arkbase_public_config",
85    "$ark_root/libpandafile:arkfile_public_config",
86  ]
87
88  deps = [
89    ":arklinker",
90    ":link_options_h",
91    "$ark_root/libpandabase:libarktsbase",
92  ]
93
94  libs = platform_libs
95  ldflags = platform_ldflags
96
97  install_enable = true
98  part_name = ark_part_name
99  subsystem_name = "$ark_subsystem_name"
100}
101