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