1# Copyright (c) 2022 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/init/begetd.gni")
15import("//build/ohos.gni")
16
17ohos_executable("client") {
18  sources = [ "client.c" ]
19  include_dirs = [
20    "//base/startup/init/services/log",
21    "//base/startup/init/interfaces/innerkits/include",
22  ]
23  deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
24  external_deps = [ "bounds_checking_function:libsec_static" ]
25  install_images = [ "system" ]
26  install_enable = true
27  part_name = "init"
28  subsystem_name = "startup"
29}
30
31ohos_executable("fd_holder_test") {
32  sources = [ "fd_holder_test.c" ]
33
34  defines = [ "INIT_AGENT" ]
35
36  deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
37
38  include_dirs = [ "//base/startup/init/interfaces/innerkits/include" ]
39
40  install_images = [ "system" ]
41  install_enable = true
42
43  part_name = "init"
44  subsystem_name = "startup"
45}
46
47ohos_prebuilt_etc("fd_holder_test.cfg") {
48  source = "//base/startup/init/test/exec_test/fd_holder_test.cfg"
49  part_name = "init"
50  subsystem_name = "startup"
51  module_install_dir = "etc/init"
52}
53
54ohos_executable("server") {
55  sources = [ "server.c" ]
56  include_dirs = [
57    "//base/startup/init/services/log",
58    "//base/startup/init/interfaces/innerkits/include",
59  ]
60  deps = [ "//base/startup/init/interfaces/innerkits:libbegetutil" ]
61  external_deps = [ "bounds_checking_function:libsec_static" ]
62  install_images = [ "system" ]
63  install_enable = true
64  part_name = "init"
65  subsystem_name = "startup"
66}
67
68ohos_executable("ondemandTest") {
69  sources = [ "sa_service_ondemand_test.cpp" ]
70
71  external_deps = [
72    "c_utils:utils",
73    "ipc:ipc_core",
74    "safwk:system_ability_fwk",
75    "samgr:samgr_proxy",
76  ]
77
78  install_images = [ "system" ]
79  install_enable = true
80  part_name = "init"
81  subsystem_name = "startup"
82}
83
84group("exectest") {
85  deps = [
86    ":client",
87    ":fd_holder_test",
88    ":fd_holder_test.cfg",
89    ":ondemandTest",
90    ":server",
91  ]
92}
93