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.
13import("//build/ohos.gni")
14SUBSYSTEM_DIR = "../../.."
15
16config("state_registry_observer_config") {
17  include_dirs = [
18    "$SUBSYSTEM_DIR/interfaces/innerkits/observer",
19    "$SUBSYSTEM_DIR/frameworks/native/common/include",
20    "$SUBSYSTEM_DIR/services/include",
21  ]
22}
23
24ohos_shared_library("tel_state_registry_api") {
25  sanitize = {
26    cfi = true
27    cfi_cross_dso = true
28    debug = false
29  }
30  branch_protector_ret = "pac_ret"
31  sources = [
32    "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer.cpp",
33    "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_client.cpp",
34    "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_proxy.cpp",
35    "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_state_manager.cpp",
36  ]
37
38  include_dirs = [ "$SUBSYSTEM_DIR/frameworks/native/observer/include" ]
39
40  version_script = "$SUBSYSTEM_DIR/interfaces/innerkits/libtel_state_registry_api.versionscript"
41
42  public_configs = [ ":state_registry_observer_config" ]
43
44  external_deps = [
45    "c_utils:utils",
46    "core_service:libtel_common",
47    "core_service:tel_core_service_api",
48    "hilog:libhilog",
49    "ipc:ipc_core",
50    "samgr:samgr_proxy",
51  ]
52
53  defines = [
54    "TELEPHONY_LOG_TAG = \"StateRegistryApi\"",
55    "LOG_DOMAIN = 0xD001F07",
56  ]
57
58  cflags_cc = [
59    "-O2",
60    "-D_FORTIFY_SOURCE=2",
61  ]
62
63  install_images = [ system_base_dir ]
64  relative_install_dir = "platformsdk"
65  innerapi_tags = [ "platformsdk" ]
66  part_name = "state_registry"
67  subsystem_name = "telephony"
68}
69