• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    if (appspawn_seccomp_privilege) {
33      cflags += [ "-DSECCOMP_PRIVILEGE" ]
34    }
35    if (appspawn_custom_sandbox) {
36      cflags += [ "-DCUSTOM_SANDBOX" ]
37    }
38  }
39}
40
41if (!defined(ohos_lite)) {
42  ohos_prebuilt_etc("appspawn.rc") {
43    source = "appspawn.cfg"
44    relative_install_dir = "init"
45    subsystem_name = "${subsystem_name}"
46    part_name = "${part_name}"
47  }
48
49  ohos_prebuilt_etc("nativespawn.rc") {
50    source = "nativespawn.cfg"
51    relative_install_dir = "init"
52    subsystem_name = "${subsystem_name}"
53    part_name = "${part_name}"
54  }
55
56  ohos_prebuilt_etc("cjappspawn.rc") {
57    source = "cjappspawn.cfg"
58    relative_install_dir = "init"
59    subsystem_name = "${subsystem_name}"
60    part_name = "${part_name}"
61  }
62}
63
64group("appspawn_all") {
65  deps = []
66  if (!defined(ohos_lite)) {
67    deps += [ "standard:appspawn" ]
68    deps += [ "standard:appspawn_helper" ]
69    deps += [ "standard:pid_ns_init" ]
70    deps += [ ":appspawn.rc" ]
71    deps += [ "etc:etc_files" ]
72    deps += [ "modules/ace_adapter:appspawn_ace" ]
73    deps += [ "modules/asan:appspawn_asan" ]
74    deps += [ "modules/nweb_adapter:appspawn_nweb" ]
75    deps += [ "modules/native_adapter:nativespawn" ]
76    deps += [ "modules/sandbox:appspawn_sandbox" ]
77    deps += [ "modules/common:appspawn_common" ]
78    deps += [ "modules/sysevent:event_reporter" ]
79    deps += [ "${appspawn_innerkits_path}/client:appspawn_client" ]
80    deps += [
81      "${appspawn_path}/modules/module_engine:libappspawn_module_engine",
82      "${appspawn_path}/modules/module_engine:libappspawn_stub_empty",
83    ]
84    deps += [ "service/hnp:hnp" ]
85    deps += [ "service/devicedebug:devicedebug" ]
86    if (appspawn_support_cj) {  # for support cj appspawn
87      deps += [
88        ":cjappspawn.rc",
89        "standard:cjappspawn",
90      ]
91    }
92    if (appspawn_support_native) {  # for support nativespawn
93      deps += [
94        ":nativespawn.rc",
95        "standard:nativespawn",
96      ]
97    }
98  } else {
99    deps += [ "lite:appspawn_lite" ]
100  }
101}
102