1# Copyright (c) 2024 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("//base/startup/appspawn/appspawn.gni")
15import("//build/ohos.gni")
16
17ohos_shared_library("nativespawn") {
18  sources = [ "native_adapter.cpp" ]
19  include_dirs = [
20    ".",
21    "${appspawn_path}/common",
22    "${appspawn_path}/standard",
23    "${appspawn_path}/util/include",
24  ]
25  deps = [
26    "${appspawn_path}/modules/module_engine:libappspawn_module_engine",
27    "${appspawn_path}/util:libappspawn_util",
28  ]
29  defines = []
30  if (asan_detector || is_asan) {
31    defines += [ "ASAN_DETECTOR" ]
32  }
33  external_deps = [
34    "ability_runtime:app_manager",
35    "ability_runtime:appkit_native",
36    "ability_runtime:runtime",
37    "c_utils:utils",
38    "eventhandler:libeventhandler",
39    "hilog:libhilog",
40    "init:libbegetutil",
41    "napi:ace_napi",
42  ]
43  subsystem_name = "${subsystem_name}"
44  part_name = "${part_name}"
45  install_enable = true
46  if (target_cpu == "arm64" || target_cpu == "x86_64" ||
47      target_cpu == "riscv64") {
48    module_install_dir = "lib64/appspawn/nativespawn"
49  } else {
50    module_install_dir = "lib/appspawn/nativespawn"
51  }
52}
53