15ba71b47Sopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
25ba71b47Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
35ba71b47Sopenharmony_ci# you may not use this file except in compliance with the License.
45ba71b47Sopenharmony_ci# You may obtain a copy of the License at
55ba71b47Sopenharmony_ci#
65ba71b47Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
75ba71b47Sopenharmony_ci#
85ba71b47Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
95ba71b47Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
105ba71b47Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115ba71b47Sopenharmony_ci# See the License for the specific language governing permissions and
125ba71b47Sopenharmony_ci# limitations under the License.
135ba71b47Sopenharmony_ci
145ba71b47Sopenharmony_ciimport("//build/ohos.gni")
155ba71b47Sopenharmony_ciimport("//foundation/systemabilitymgr/samgr/services/samgr/var.gni")
165ba71b47Sopenharmony_ci
175ba71b47Sopenharmony_ciconfig("all_config_samgr_common") {
185ba71b47Sopenharmony_ci  include_dirs = [ "include" ]
195ba71b47Sopenharmony_ci}
205ba71b47Sopenharmony_ci
215ba71b47Sopenharmony_ciconfig("config_samgr_common") {
225ba71b47Sopenharmony_ci  include_dirs = [
235ba71b47Sopenharmony_ci    "include",
245ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
255ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/services/dfx/include",
265ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/services/lsamgr/include",
275ba71b47Sopenharmony_ci  ]
285ba71b47Sopenharmony_ci}
295ba71b47Sopenharmony_ci
305ba71b47Sopenharmony_ci################################################################################
315ba71b47Sopenharmony_ciohos_shared_library("samgr_common") {
325ba71b47Sopenharmony_ci  version_script = "libsamgr_common.versionscript"
335ba71b47Sopenharmony_ci  sanitize = {
345ba71b47Sopenharmony_ci    integer_overflow = true
355ba71b47Sopenharmony_ci    boundary_sanitize = true
365ba71b47Sopenharmony_ci    ubsan = true
375ba71b47Sopenharmony_ci    cfi = true
385ba71b47Sopenharmony_ci    cfi_cross_dso = true
395ba71b47Sopenharmony_ci    debug = false
405ba71b47Sopenharmony_ci    cfi_no_nvcall = true
415ba71b47Sopenharmony_ci    blocklist = "../../../cfi_blocklist.txt"
425ba71b47Sopenharmony_ci  }
435ba71b47Sopenharmony_ci  branch_protector_ret = "pac_ret"
445ba71b47Sopenharmony_ci
455ba71b47Sopenharmony_ci  sources = [
465ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/services/common/src/parse_util.cpp",
475ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/services/dfx/source/hisysevent_adapter.cpp",
485ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/services/dfx/source/samgr_xcollie.cpp",
495ba71b47Sopenharmony_ci  ]
505ba71b47Sopenharmony_ci
515ba71b47Sopenharmony_ci  defines = []
525ba71b47Sopenharmony_ci
535ba71b47Sopenharmony_ci  configs = [
545ba71b47Sopenharmony_ci    ":config_samgr_common",
555ba71b47Sopenharmony_ci    "//foundation/systemabilitymgr/samgr/test/resource:coverage_flags",
565ba71b47Sopenharmony_ci  ]
575ba71b47Sopenharmony_ci
585ba71b47Sopenharmony_ci  public_configs = [
595ba71b47Sopenharmony_ci    ":config_samgr_common",
605ba71b47Sopenharmony_ci    ":all_config_samgr_common",
615ba71b47Sopenharmony_ci  ]
625ba71b47Sopenharmony_ci
635ba71b47Sopenharmony_ci  external_deps = [ "libxml2:libxml2" ]
645ba71b47Sopenharmony_ci
655ba71b47Sopenharmony_ci  all_dependent_configs = [
665ba71b47Sopenharmony_ci    ":all_config_samgr_common",
675ba71b47Sopenharmony_ci    "//third_party/libxml2:libxml2_config",
685ba71b47Sopenharmony_ci  ]
695ba71b47Sopenharmony_ci
705ba71b47Sopenharmony_ci  if (is_standard_system) {
715ba71b47Sopenharmony_ci    external_deps += [
725ba71b47Sopenharmony_ci      "c_utils:utils",
735ba71b47Sopenharmony_ci      "hilog:libhilog",
745ba71b47Sopenharmony_ci      "hisysevent:libhisysevent",
755ba71b47Sopenharmony_ci      "hitrace:hitrace_meter",
765ba71b47Sopenharmony_ci    ]
775ba71b47Sopenharmony_ci
785ba71b47Sopenharmony_ci    if (hicollie_able) {
795ba71b47Sopenharmony_ci      external_deps += [ "hicollie:libhicollie" ]
805ba71b47Sopenharmony_ci      defines += [ "HICOLLIE_ENABLE" ]
815ba71b47Sopenharmony_ci    }
825ba71b47Sopenharmony_ci    public_external_deps = [ "json:nlohmann_json_static" ]
835ba71b47Sopenharmony_ci    part_name = "samgr"
845ba71b47Sopenharmony_ci  }
855ba71b47Sopenharmony_ci
865ba71b47Sopenharmony_ci  innerapi_tags = [ "platformsdk" ]
875ba71b47Sopenharmony_ci  subsystem_name = "systemabilitymgr"
885ba71b47Sopenharmony_ci}
895ba71b47Sopenharmony_ci################################################################################
90