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 14import("//base/update/updater/updater_default_cfg.gni") 15import("//build/ohos.gni") 16 17updater_path = rebase_path("${updater_absolutely_path}", ".") 18 19config("libutils_exported_headers") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 "${updater_path}/services/include", 23 "${updater_path}/utils/include", 24 "${updater_path}/utils/json", 25 ] 26} 27 28ohos_static_library("libutils") { 29 sources = [ 30 "json/json_node.cpp", 31 "utils.cpp", 32 ] 33 34 include_dirs = [ 35 "include", 36 "${updater_path}/interfaces/kits/include/", 37 "${updater_path}/services/common/", 38 "${updater_path}/services/include/", 39 "//third_party/bounds_checking_function/include", 40 "//third_party/cJSON", 41 ] 42 43 public_configs = [ ":libutils_exported_headers" ] 44 45 deps = [ 46 "//third_party/bounds_checking_function:libsec_static", 47 "//third_party/cJSON:cjson", 48 ] 49 external_deps = [ "init:libbegetutil" ] 50 51 if (build_selinux) { 52 external_deps += [ "selinux_adapter:librestorecon" ] 53 deps += [ "//third_party/selinux:libselinux" ] 54 include_dirs += [ "//third_party/selinux/libselinux/include" ] 55 cflags = [ "-DWITH_SELINUX" ] 56 } 57 58 subsystem_name = "updater" 59 part_name = "updater" 60} 61 62ohos_executable("updater_reboot") { 63 sources = [ "updater_reboot.cpp" ] 64 65 include_dirs = [ 66 "include", 67 "${updater_path}/interfaces/kits/include/", 68 "${updater_path}/services/include/", 69 ] 70 71 deps = [ 72 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 73 "${updater_path}/services/fs_manager:libfsmanager", 74 "${updater_path}/utils:libutils", 75 ] 76 install_images = [ "updater" ] 77 install_enable = true 78 part_name = "updater" 79 subsystem_name = "updater" 80} 81 82ohos_executable("write_updater") { 83 sources = [ "write_updater.cpp" ] 84 85 include_dirs = [ 86 "include", 87 "${updater_path}/interfaces/kits/include/", 88 "${updater_path}/services/include/", 89 "//third_party/bounds_checking_function/include", 90 "//base/startup/init/interfaces/innerkits/include", 91 ] 92 93 deps = [ 94 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 95 "//third_party/bounds_checking_function:libsec_static", 96 ] 97 external_deps = [ "init:libbegetutil" ] 98 99 install_enable = true 100 part_name = "updater" 101 subsystem_name = "updater" 102} 103