1 Star 0 Fork 502

ajunlonglive/startup_appspawn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BUILD.gn 5.60 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/appspawn/appspawn.gni")
import("//build/ohos.gni")
config("appspawn_config") {
visibility = [ ":*" ]
include_dirs = [
"common",
"standard",
"adapter",
"interfaces/innerkits/include",
"//commonlibrary/c_utils/base/include",
"util/include",
"${ability_runtime_path}/interfaces/kits/native/appkit/app",
"//base/global/resource_management/interfaces/inner_api/include",
"//base/security/access_token/interfaces/innerkits/token_setproc/include",
"//base/startup/init/services/log",
"//base/startup/init/services/include",
"//base/startup/init/services/loopevent/include",
"//base/startup/init/interfaces/innerkits/include",
"//third_party/json/include",
]
if (build_selinux) {
cflags = [ "-DWITH_SELINUX" ]
}
}
ohos_executable("appspawn") {
sources = [
"${appspawn_path}/adapter/appspawn_ace.cpp",
"${appspawn_path}/standard/main.c",
]
configs = [ ":appspawn_config" ]
deps = [
"${ability_runtime_path}/frameworks/native/appkit:appkit_native",
"${appspawn_path}:appspawn_server",
]
external_deps = [
"ability_base:want",
"ability_runtime:app_manager",
"ability_runtime:runtime",
"c_utils:utils",
"eventhandler:libeventhandler",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
"napi:ace_napi",
]
install_enable = true
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
ohos_static_library("appspawn_server") {
sources = [
"${appspawn_path}/adapter/appspawn_adapter.cpp",
"${appspawn_path}/adapter/appspawn_sandbox.cpp",
"${appspawn_path}/common/appspawn_server.c",
"${appspawn_path}/standard/appspawn_process.c",
"${appspawn_path}/standard/appspawn_service.c",
"${appspawn_path}/util/src/json_utils.cpp",
"${appspawn_path}/util/src/sandbox_utils.cpp",
]
defines = [
"GRAPHIC_PERMISSION_CHECK",
"INIT_AGENT",
]
if (asan_detector) {
defines += [ "ASAN_DETECTOR" ]
}
configs = [ ":appspawn_config" ]
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64z" ]
deps = [
"//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc",
"//base/startup/init/interfaces/innerkits:libbegetutil",
"//foundation/communication/netmanager_base/services/netmanagernative/netsys_client:netsys_client",
]
external_deps = [
"c_utils:utils",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
]
if (build_selinux) {
external_deps += [ "selinux:libhap_restorecon" ]
}
cflags = []
if (build_seccomp) {
cflags += [ "-DWITH_SECCOMP" ]
external_deps += [ "init:seccomp" ]
}
if (appspawn_report_event) {
cflags += [ "-DREPORT_EVENT" ]
deps += [ "adapter/sysevent:event_reporter" ]
}
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
ohos_prebuilt_etc("appspawn.rc") {
source = "appspawn.cfg"
relative_install_dir = "init"
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
ohos_static_library("nwebspawn_server") {
sources = [
"${appspawn_path}/adapter/appspawn_adapter.cpp",
"${appspawn_path}/adapter/appspawn_sandbox.cpp",
"${appspawn_path}/common/appspawn_server.c",
"${appspawn_path}/standard/appspawn_process.c",
"${appspawn_path}/standard/appspawn_service.c",
"${appspawn_path}/util/src/json_utils.cpp",
"${appspawn_path}/util/src/sandbox_utils.cpp",
]
defines = [
"GRAPHIC_PERMISSION_CHECK",
"INIT_AGENT",
"NWEB_SPAWN",
]
configs = [ ":appspawn_config" ]
ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64z" ]
deps = [
"//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc",
"//foundation/communication/netmanager_base/services/netmanagernative/netsys_client:netsys_client",
]
external_deps = [
"c_utils:utils",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
]
if (build_selinux) {
external_deps += [ "selinux:libhap_restorecon" ]
}
cflags = []
if (build_seccomp) {
cflags += [ "-DWITH_SECCOMP" ]
external_deps += [ "init:seccomp" ]
}
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
ohos_executable("nwebspawn") {
defines = [ "NWEB_SPAWN" ]
if (target_cpu == "arm64") {
defines += [ "webview_arm64" ]
}
sources = [
"${appspawn_path}/adapter/appspawn_nweb.cpp",
"${appspawn_path}/standard/main.c",
"${appspawn_path}/util/src/json_utils.cpp",
"${appspawn_path}/util/src/sandbox_utils.cpp",
]
configs = [ ":appspawn_config" ]
deps = [ "${appspawn_path}:nwebspawn_server" ]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
install_enable = true
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
ohos_prebuilt_etc("nwebspawn.rc") {
source = "nwebspawn.cfg"
relative_install_dir = "init"
subsystem_name = "${subsystem_name}"
part_name = "${part_name}"
}
group("nweb") {
deps = []
if (appspawn_support_nweb) {
deps += [
":nwebspawn",
":nwebspawn.rc",
]
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ajunlonglive/startup_appspawn.git
git@gitee.com:ajunlonglive/startup_appspawn.git
ajunlonglive
startup_appspawn
startup_appspawn
master

搜索帮助