1# Copyright (c) 2024 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/updateservice/foundations/foundations.gni")
15import("//base/update/updateservice/updateengine.gni")
16import("//build/ohos.gni")
17
18config("update_service_foundations_config") {
19  include_dirs = foundations_include
20}
21
22ohos_shared_library("update_foundations") {
23  sanitize = {
24    integer_overflow = true
25    ubsan = true
26    boundary_sanitize = true
27    cfi = true
28    cfi_cross_dso = true
29    debug = false
30  }
31  branch_protector_ret = "pac_ret"
32
33  defines = []
34  if (!ability_ability_runtime_enable) {
35    defines += [ "ABILITY_RUNTIME_INNER_ENABLE" ]
36  }
37
38  include_dirs = foundations_include
39  sources = foundations_sources
40  deps = foundations_deps
41  external_deps = foundations_external_deps
42
43  public_configs = [ ":update_service_foundations_config" ]
44
45  cflags = [
46    "-fPIC",
47    "-Os",
48    "-Werror",
49  ]
50  part_name = "$updateengine_part_name"
51  subsystem_name = "updater"
52}
53