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 ] 23 24 cflags = [] 25 if (build_selinux) { 26 cflags += [ "-DWITH_SELINUX" ] 27 } 28 29 if (build_seccomp) { 30 cflags += [ "-DWITH_SECCOMP" ] 31 if (appspawn_seccomp_privilege) { 32 cflags += [ "-DSECCOMP_PRIVILEGE" ] 33 } 34 if (appspawn_custom_sandbox) { 35 cflags += [ "-DCUSTOM_SANDBOX" ] 36 } 37 } 38} 39 40if (!defined(ohos_lite)) { 41 ohos_prebuilt_etc("appspawn.rc") { 42 source = "appspawn.cfg" 43 relative_install_dir = "init" 44 subsystem_name = "${subsystem_name}" 45 part_name = "${part_name}" 46 } 47 48 ohos_prebuilt_etc("nativespawn.rc") { 49 source = "nativespawn.cfg" 50 relative_install_dir = "init" 51 subsystem_name = "${subsystem_name}" 52 part_name = "${part_name}" 53 } 54 55 ohos_prebuilt_etc("cjappspawn.rc") { 56 source = "cjappspawn.cfg" 57 relative_install_dir = "init" 58 subsystem_name = "${subsystem_name}" 59 part_name = "${part_name}" 60 } 61 62 ohos_prebuilt_etc("nwebspawn.rc") { 63 source = "nwebspawn.cfg" 64 relative_install_dir = "init" 65 subsystem_name = "${subsystem_name}" 66 part_name = "${part_name}" 67 } 68 69 ohos_prebuilt_etc("hybridspawn.cfg") { 70 source = "hybridspawn.cfg" 71 relative_install_dir = "init" 72 subsystem_name = "${subsystem_name}" 73 part_name = "${part_name}" 74 } 75} 76 77group("appspawn_all") { 78 deps = [] 79 if (!defined(ohos_lite)) { 80 deps += [ "standard:appspawn" ] 81 deps += [ "standard:appspawn_helper" ] 82 deps += [ "standard:pid_ns_init" ] 83 deps += [ ":appspawn.rc" ] 84 deps += [ "etc:etc_files" ] 85 deps += [ "modules/ace_adapter:appspawn_ace" ] 86 deps += [ "modules/asan:appspawn_asan" ] 87 deps += [ "modules/native_adapter:nativespawn" ] 88 deps += [ "modules/sandbox:appspawn_sandbox" ] 89 deps += [ "modules/common:appspawn_common" ] 90 deps += [ "modules/sysevent:event_reporter" ] 91 deps += [ "${appspawn_innerkits_path}/client:appspawn_client" ] 92 deps += [ "${appspawn_innerkits_path}/dec_util:appspawn_dec_util" ] 93 deps += [ 94 "${appspawn_path}/modules/module_engine:libappspawn_module_engine", 95 "${appspawn_path}/modules/module_engine:libappspawn_stub_empty", 96 ] 97 deps += [ "service/hnp:hnp" ] 98 deps += [ "service/devicedebug:devicedebug" ] 99 if (appspawn_support_cj) { # for support cj appspawn 100 deps += [ 101 ":cjappspawn.rc", 102 "standard:cjappspawn", 103 ] 104 } 105 if (appspawn_support_nweb) { 106 deps += [ "modules/nweb_adapter:appspawn_nweb" ] 107 } 108 if (appspawn_support_native) { # for support nativespawn 109 deps += [ 110 ":nativespawn.rc", 111 "standard:nativespawn", 112 ] 113 } 114 if (appspawn_support_nweb) { # for support nwebspawn 115 deps += [ 116 ":nwebspawn.rc", 117 "standard:nwebspawn", 118 ] 119 } 120 if (appspawn_support_hybrid) { # for support hybridspawn 121 deps += [ 122 ":hybridspawn.cfg", 123 "standard:hybridspawn", 124 ] 125 } 126 } else { 127 deps += [ "lite:appspawn_lite" ] 128 } 129} 130