• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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
14if (defined(ohos_lite)) {
15  group("libinit_module_engine") {
16  }
17} else {
18  import("//build/ohos.gni")
19  import("//build/ohos/native_stub/native_stub.gni")
20
21  #
22  # exported include directories
23  #
24  config("init_module_engine_exported_config") {
25    visibility = [ ":*" ]
26    include_dirs = [
27      "include/",
28      "//base/startup/init/services/include",
29      "//base/startup/init/interfaces/innerkits/include",
30      "//base/startup/init/services/log",
31      "//third_party/cJSON",
32    ]
33  }
34
35  #
36  # innerkits for module development
37  #
38  ohos_native_stub_library("libinit_module_engine") {
39    output_extension = "so"
40    public_configs = [ ":init_module_engine_exported_config" ]
41    stub_description_file = "./stub/libinit.stub.json"
42  }
43
44  #
45  # For init linking,
46  # export symbols defined in this json files only
47  #
48  ohos_native_stub_versionscript("libinit_stub_versionscript") {
49    stub_description_file = "./stub/libinit.stub.json"
50  }
51
52  #
53  # Generate empty library with symlink name to satisfy init loading required libraries
54  #
55  ohos_native_stub_library("libinit_stub_empty") {
56    output_extension = "so"
57    stub_description_file = "./stub/libinit.stub.empty.json"
58    part_name = "init"
59    subsystem_name = "startup"
60    install_enable = true
61    install_images = [
62      "system",
63      "updater",
64      "ramdisk",
65    ]
66    symlink_target_name = [ "libinit_module_engine.so" ]
67  }
68
69  config("init_module_engine_sources_config") {
70    include_dirs = [
71      "//base/startup/init/interfaces/innerkits/init_module_engine/include",
72      "//base/startup/init/interfaces/innerkits/include",
73      "//base/startup/init/services/include",
74      "//base/startup/init/services/log",
75      "//third_party/cJSON",
76    ]
77  }
78
79  ohos_source_set("init_module_engine_sources") {
80    sources = [ "init_modulemgr.c" ]
81    public_configs = [ ":init_module_engine_sources_config" ]
82  }
83}
84
85#
86# init module engine all modules
87#
88group("modulegroup") {
89  if (!defined(ohos_lite)) {
90    deps = [
91      ":libinit_module_engine",
92      ":libinit_stub_empty",
93    ]
94  }
95}
96