• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//ark/runtime_core/ark_config.gni")
15import("//build/ohos.gni")
16
17config("arkbase_public_config") {
18  include_dirs = [
19    "$ark_root/libpandabase",
20    "$target_gen_dir",
21  ]
22}
23
24ark_gen_file("base_options_h") {
25  template_file = "../templates/options/options.h.erb"
26  data_file = "options.yaml"
27  requires = [ "../templates/common.rb" ]
28  output_file = "$target_gen_dir/generated/base_options.h"
29}
30
31ark_gen_file("events_gen") {
32  template_file = "events/events_gen.h.erb"
33  data_file = "events/events.yaml"
34  requires = [ "events/events.rb" ]
35  output_file = "$target_gen_dir/events_gen.h"
36}
37
38if (is_mingw) {
39  libarkbase_sources = [
40    "$ark_root/libpandabase/mem/arena.cpp",
41    "$ark_root/libpandabase/mem/arena_allocator.cpp",
42    "$ark_root/libpandabase/mem/base_mem_stats.cpp",
43    "$ark_root/libpandabase/mem/mem_config.cpp",
44    "$ark_root/libpandabase/mem/pool_manager.cpp",
45    "$ark_root/libpandabase/mem/pool_map.cpp",
46    "$ark_root/libpandabase/os/dfx_option.cpp",
47    "$ark_root/libpandabase/os/filesystem.cpp",
48    "$ark_root/libpandabase/os/stacktrace_stub.cpp",
49    "$ark_root/libpandabase/os/unix/mutex.cpp",
50    "$ark_root/libpandabase/os/windows/error.cpp",
51    "$ark_root/libpandabase/os/windows/file.cpp",
52    "$ark_root/libpandabase/os/windows/mem.cpp",
53    "$ark_root/libpandabase/os/windows/thread.cpp",
54    "$ark_root/libpandabase/trace/windows/trace.cpp",
55    "$ark_root/libpandabase/utils/dfx.cpp",
56    "$ark_root/libpandabase/utils/json_parser.cpp",
57    "$ark_root/libpandabase/utils/logger.cpp",
58    "$ark_root/libpandabase/utils/utf.cpp",
59  ]
60} else {
61  libarkbase_sources = [
62    "$ark_root/libpandabase/mem/arena.cpp",
63    "$ark_root/libpandabase/mem/arena_allocator.cpp",
64    "$ark_root/libpandabase/mem/base_mem_stats.cpp",
65    "$ark_root/libpandabase/mem/code_allocator.cpp",
66    "$ark_root/libpandabase/mem/mem_config.cpp",
67    "$ark_root/libpandabase/mem/pool_manager.cpp",
68    "$ark_root/libpandabase/mem/pool_map.cpp",
69    "$ark_root/libpandabase/os/dfx_option.cpp",
70    "$ark_root/libpandabase/os/native_stack.cpp",
71    "$ark_root/libpandabase/os/property.cpp",
72
73    # product build
74    "$ark_root/libpandabase/os/stacktrace_stub.cpp",
75    "$ark_root/libpandabase/os/time.cpp",
76    "$ark_root/libpandabase/os/unix/error.cpp",
77    "$ark_root/libpandabase/os/unix/file.cpp",
78    "$ark_root/libpandabase/os/unix/filesystem.cpp",
79    "$ark_root/libpandabase/os/unix/library_loader.cpp",
80    "$ark_root/libpandabase/os/unix/mem.cpp",
81    "$ark_root/libpandabase/os/unix/native_stack.cpp",
82    "$ark_root/libpandabase/os/unix/property.cpp",
83    "$ark_root/libpandabase/os/unix/thread.cpp",
84    "$ark_root/libpandabase/os/unix/time_unix.cpp",
85    "$ark_root/libpandabase/trace/trace.cpp",
86    "$ark_root/libpandabase/trace/unix/trace.cpp",
87    "$ark_root/libpandabase/utils/dfx.cpp",
88    "$ark_root/libpandabase/utils/json_parser.cpp",
89    "$ark_root/libpandabase/utils/logger.cpp",
90    "$ark_root/libpandabase/utils/terminate.cpp",
91    "$ark_root/libpandabase/utils/time.cpp",
92    "$ark_root/libpandabase/utils/type_converter.cpp",
93    "$ark_root/libpandabase/utils/utf.cpp",
94  ]
95
96  if (!is_mac) {
97    libarkbase_sources += [
98      "$ark_root/libpandabase/os/filesystem.cpp",
99      "$ark_root/libpandabase/os/unix/exec.cpp",
100      "$ark_root/libpandabase/os/unix/futex/mutex.cpp",
101      "$ark_root/libpandabase/os/unix/pipe.cpp",
102      "$ark_root/libpandabase/os/unix/sighooklib/sighook.cpp",
103    ]
104  } else {
105    libarkbase_sources += [ "$ark_root/libpandabase/os/unix/mutex.cpp" ]
106  }
107}
108
109if (is_debug) {
110  libarkbase_sources += [ "$ark_root/libpandabase/utils/debug.cpp" ]
111}
112
113libarkbase_configs = [
114  sdk_libc_secshared_config,
115  ":arkbase_public_config",
116  "$ark_root:ark_config",
117]
118
119libarkbase_deps = [
120  ":base_options_h",
121  ":events_gen",
122  sdk_libc_secshared_dep,
123]
124
125ohos_shared_library("libarkbase") {
126  sources = libarkbase_sources
127
128  configs = libarkbase_configs
129
130  deps = libarkbase_deps
131
132  output_extension = "so"
133  if (!is_standard_system) {
134    relative_install_dir = "ark"
135  }
136  subsystem_name = "ark"
137}
138
139ohos_static_library("libarkbase_frontend_static") {
140  sources = libarkbase_sources
141
142  configs = libarkbase_configs
143
144  deps = libarkbase_deps
145}
146