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.
13import("//base/startup/appspawn/appspawn.gni")
14import("//build/ohos.gni")
15
16config("appspawn_config") {
17  visibility = [ "./*" ]
18  include_dirs = [
19    "${appspawn_innerkits_path}/include",
20    "${appspawn_path}/modules/module_engine/include",
21    "${appspawn_path}/util/include",
22    "//commonlibrary/c_utils/base/include",
23  ]
24
25  cflags = []
26  if (build_selinux) {
27    cflags += [ "-DWITH_SELINUX" ]
28  }
29
30  if (build_seccomp) {
31    cflags += [ "-DWITH_SECCOMP" ]
32  }
33}
34
35if (!defined(ohos_lite)) {
36  ohos_prebuilt_etc("appspawn.rc") {
37    source = "appspawn.cfg"
38    relative_install_dir = "init"
39    subsystem_name = "${subsystem_name}"
40    part_name = "${part_name}"
41  }
42
43  ohos_prebuilt_etc("nativespawn.rc") {
44    source = "nativespawn.cfg"
45    relative_install_dir = "init"
46    subsystem_name = "${subsystem_name}"
47    part_name = "${part_name}"
48  }
49
50  ohos_prebuilt_etc("cjappspawn.rc") {
51    source = "cjappspawn.cfg"
52    relative_install_dir = "init"
53    subsystem_name = "${subsystem_name}"
54    part_name = "${part_name}"
55  }
56}
57
58group("appspawn_all") {
59  deps = []
60  if (!defined(ohos_lite)) {
61    deps += [ "standard:appspawn" ]
62    deps += [ "standard:appspawn_helper" ]
63    deps += [ "standard:pid_ns_init" ]
64    deps += [ ":appspawn.rc" ]
65    deps += [ "etc:etc_files" ]
66    deps += [ "modules/ace_adapter:appspawn_ace" ]
67    deps += [ "modules/asan:appspawn_asan" ]
68    deps += [ "modules/nweb_adapter:appspawn_nweb" ]
69    deps += [ "modules/native_adapter:nativespawn" ]
70    deps += [ "modules/sandbox:appspawn_sandbox" ]
71    deps += [ "modules/common:appspawn_common" ]
72    deps += [ "modules/sysevent:event_reporter" ]
73    deps += [ "${appspawn_innerkits_path}/client:appspawn_client" ]
74    deps += [
75      "${appspawn_path}/modules/module_engine:libappspawn_module_engine",
76      "${appspawn_path}/modules/module_engine:libappspawn_stub_empty",
77    ]
78    deps += [ "service/hnp:hnp" ]
79    deps += [ "service/devicedebug:devicedebug" ]
80    if (appspawn_support_cj) {  # for support cj appspawn
81      deps += [
82        ":cjappspawn.rc",
83        "standard:cjappspawn",
84      ]
85    }
86    if (appspawn_support_native) {  # for support nativespawn
87      deps += [
88        ":nativespawn.rc",
89        "standard:nativespawn",
90      ]
91    }
92  } else {
93    deps += [ "lite:appspawn_lite" ]
94  }
95}
96