• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022-2023 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("//build/ohos.gni")
15import("//build/ohos_var.gni")
16import("../nfc.gni")
17
18config("nfc_config") {
19  visibility = [ ":*" ]
20
21  defines = [ "DEBUG" ]
22  if (nfc_use_vendor_nci_native) {
23    defines += [ "USE_VENDOR_NCI_NATIVE" ]
24  }
25
26  if (nfc_service_feature_vendor_applications_enabled) {
27    defines += [ "VENDOR_APPLICATIONS_ENABLED" ]
28  }
29
30  include_dirs = [
31    "include",
32    "src/ipc/controller",
33    "src/ipc/tags",
34    "src/ipc/card_emulation",
35    "src/nci_adapter",
36    "src/utils",
37    "src/card_emulation",
38    "src/external_deps",
39    "$NFC_DIR/interfaces/inner_api/common",
40  ]
41}
42
43nfc_service_source = [
44  "src/card_emulation/ce_service.cpp",
45  "src/card_emulation/host_card_emulation_manager.cpp",
46  "src/card_emulation/nfc_ability_connection_callback.cpp",
47  "src/card_emulation/setting_data_share_impl.cpp",
48  "src/external_deps/app_data_parser.cpp",
49  "src/external_deps/external_deps_proxy.cpp",
50  "src/external_deps/nfc_data_share_impl.cpp",
51  "src/external_deps/nfc_event_publisher.cpp",
52  "src/external_deps/nfc_hisysevent.cpp",
53  "src/external_deps/nfc_permission_checker.cpp",
54  "src/external_deps/nfc_preferences.cpp",
55  "src/external_deps/tag_ability_dispatcher.cpp",
56  "src/ipc/controller/ndef_msg_callback_proxy.cpp",
57  "src/ipc/controller/nfc_controller_callback_proxy.cpp",
58  "src/ipc/controller/nfc_controller_death_recipient.cpp",
59  "src/ipc/controller/nfc_controller_impl.cpp",
60  "src/ipc/controller/nfc_controller_stub.cpp",
61  "src/ipc/tags/foreground_callback_proxy.cpp",
62  "src/ipc/tags/foreground_death_recipient.cpp",
63  "src/ipc/tags/reader_mode_callback_proxy.cpp",
64  "src/ipc/tags/reader_mode_death_recipient.cpp",
65  "src/ipc/tags/tag_session.cpp",
66  "src/ipc/tags/tag_session_stub.cpp",
67  "src/nci_adapter/nci_ce_proxy.cpp",
68  "src/nci_adapter/nci_native_selector.cpp",
69  "src/nci_adapter/nci_nfcc_proxy.cpp",
70  "src/nci_adapter/nci_tag_proxy.cpp",
71  "src/ndef_bt_oob_data_parser.cpp",
72  "src/nfc_event_handler.cpp",
73  "src/nfc_polling_manager.cpp",
74  "src/nfc_polling_params.cpp",
75  "src/nfc_routing_manager.cpp",
76  "src/nfc_sa_manager.cpp",
77  "src/nfc_service.cpp",
78  "src/tag_dispatcher.cpp",
79  "src/utils/app_state_observer.cpp",
80  "src/utils/nfc_timer.cpp",
81  "src/utils/nfc_watch_dog.cpp",
82  "src/ipc/card_emulation/hce_cmd_callback_proxy.cpp",
83  "src/ipc/card_emulation/hce_cmd_death_recipient.cpp",
84  "src/ipc/card_emulation/hce_session.cpp",
85  "src/ipc/card_emulation/hce_session_stub.cpp",
86]
87if (nfc_service_feature_vendor_applications_enabled) {
88  nfc_service_source += [
89    "src/ipc/controller/on_card_emulation_notify_cb_proxy.cpp",
90    "src/ipc/controller/query_app_info_callback_proxy.cpp",
91  ]
92}
93
94nfc_service_external_deps = [
95  "ability_base:want",
96  "ability_base:zuri",
97  "ability_runtime:ability_manager",
98  "ability_runtime:app_manager",
99  "ability_runtime:dataobs_manager",
100  "access_token:libaccesstoken_sdk",
101  "bundle_framework:appexecfwk_base",
102  "bundle_framework:appexecfwk_core",
103  "c_utils:utils",
104  "common_event_service:cesfwk_core",
105  "common_event_service:cesfwk_innerkits",
106  "data_share:datashare_consumer",
107  "eventhandler:libeventhandler",
108  "hilog:libhilog",
109  "hisysevent:libhisysevent",
110  "ipc:ipc_core",
111  "miscdevice:vibrator_interface_native",
112  "power_manager:powermgr_client",
113  "preferences:native_preferences",
114  "safwk:system_ability_fwk",
115  "samgr:samgr_proxy",
116  "screenlock_mgr:screenlock_client",
117]
118
119####################### nfc_service ################
120ohos_shared_library("nfc_service") {
121  sanitize = {
122    cfi = true
123    boundary_sanitize = true
124    integer_overflow = true
125    cfi_cross_dso = true
126    debug = false
127  }
128  branch_protector_ret = "pac_ret"
129  sources = nfc_service_source
130
131  public_configs = [ ":nfc_config" ]
132
133  # Used to control the export of dynamic library symbols.
134  version_script = "libnfc_service_version_script.txt"
135
136  deps = [
137    "$NFC_DIR/interfaces/inner_api/common:nfc_inner_kits_common",
138    "etc/init:etc",
139  ]
140
141  if (!nfc_use_vendor_nci_native) {
142    deps += [ "src/nci_adapter/nci_native_default:nci_native_default" ]
143  }
144
145  external_deps = nfc_service_external_deps
146
147  part_name = "nfc"
148  subsystem_name = "communication"
149}
150
151####################### nfc_service_static ################
152# Only used for unittest
153ohos_static_library("nfc_service_static") {
154  sanitize = {
155    cfi = true
156    boundary_sanitize = true
157    integer_overflow = true
158    cfi_cross_dso = true
159    debug = false
160  }
161  sources = nfc_service_source
162  public_configs = [ ":nfc_config" ]
163
164  deps = [
165    "$NFC_DIR/interfaces/inner_api/common:nfc_inner_kits_common",
166    "etc/init:etc",
167  ]
168
169  if (!nfc_use_vendor_nci_native) {
170    deps += [ "src/nci_adapter/nci_native_default:nci_native_default" ]
171  }
172
173  external_deps = nfc_service_external_deps
174
175  part_name = "nfc"
176  subsystem_name = "communication"
177}
178