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