• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022-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/location/config.gni")
15import("//build/ohos.gni")
16
17local_base_sources = [
18  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/beacon_fence_napi.cpp",
19  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/bluetooth_scan_result_callback_napi.cpp",
20  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/cached_locations_callback_napi.cpp",
21  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/country_code_callback_napi.cpp",
22  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/geofence_napi.cpp",
23  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/gnss_status_callback_napi.cpp",
24  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/locating_required_data_callback_napi.cpp",
25  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_error_callback_napi.cpp",
26  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_gnss_geofence_callback_napi.cpp",
27  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_adapter.cpp",
28  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_entry.cpp",
29  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_errcode.cpp",
30  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_event.cpp",
31  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_system.cpp",
32  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_switch_callback_napi.cpp",
33  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/locator_callback_napi.cpp",
34  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/napi_util.cpp",
35  "$LOCATION_ROOT_DIR/frameworks/js/napi/source/nmea_message_callback_napi.cpp",
36]
37
38if (notification_distributed_notification_service_enable) {
39  local_notification_sources = [
40    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi.cpp",
41    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_content.cpp",
42    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_liveview.cpp",
43    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_notification.cpp",
44    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_request.cpp",
45    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_utils.cpp",
46  ]
47
48  notification_external_deps = [
49    "ability_base:session_info",
50    "ability_base:want",
51    "ability_runtime:napi_common",
52    "distributed_notification_service:ans_innerkits",
53    "image_framework:image",
54    "relational_store:native_rdb",
55  ]
56}
57
58ohos_shared_library("geolocation") {
59  sanitize = {
60    cfi = true
61    cfi_cross_dso = true
62    debug = false
63  }
64  branch_protector_ret = "pac_ret"
65  install_enable = true
66  include_dirs = [
67    "$LOCATION_ROOT_DIR/frameworks/js/napi/include",
68    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include",
69    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
70  ]
71
72  sources = local_base_sources
73
74  deps = [
75    "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
76    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
77    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk",
78    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk",
79  ]
80
81  external_deps = [
82    "hilog:libhilog",
83    "ipc:ipc_single",
84    "napi:ace_napi",
85  ]
86
87  defines = []
88
89  if (notification_distributed_notification_service_enable) {
90    sources += local_notification_sources
91    external_deps += notification_external_deps
92    defines += [ "NOTIFICATION_ENABLE" ]
93  }
94
95  if (location_feature_with_jsstack) {
96    defines += [ "SUPPORT_JSSTACK" ]
97    external_deps += [ "hiview:libxpower_event_js" ]
98  }
99
100  relative_install_dir = "module"
101  part_name = "location"
102  subsystem_name = "location"
103}
104
105ohos_static_library("geolocation_static") {
106  sanitize = {
107    cfi = true
108    cfi_cross_dso = true
109    debug = false
110  }
111  branch_protector_ret = "pac_ret"
112  include_dirs = [
113    "$LOCATION_ROOT_DIR/frameworks/js/napi/include",
114    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
115    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include",
116  ]
117
118  sources = local_base_sources
119
120  deps = [
121    "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
122    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
123    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk",
124    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk",
125  ]
126
127  external_deps = [
128    "hilog:libhilog",
129    "ipc:ipc_single",
130    "napi:ace_napi",
131  ]
132
133  defines = []
134
135  if (notification_distributed_notification_service_enable) {
136    sources += local_notification_sources
137    external_deps += notification_external_deps
138    defines += [ "NOTIFICATION_ENABLE" ]
139  }
140  part_name = "location"
141  subsystem_name = "location"
142}
143
144ohos_shared_library("geolocationmanager") {
145  install_enable = true
146  sanitize = {
147    cfi = true
148    cfi_cross_dso = true
149    debug = false
150  }
151  branch_protector_ret = "pac_ret"
152  include_dirs = [
153    "$LOCATION_ROOT_DIR/frameworks/js/napi/include",
154    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
155    "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include",
156  ]
157
158  sources = local_base_sources
159
160  deps = [
161    "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
162    "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
163    "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk",
164    "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk",
165  ]
166
167  defines = [ "ENABLE_NAPI_MANAGER" ]
168
169  external_deps = [
170    "hilog:libhilog",
171    "ipc:ipc_single",
172    "napi:ace_napi",
173  ]
174
175  if (notification_distributed_notification_service_enable) {
176    sources += local_notification_sources
177    external_deps += notification_external_deps
178    defines += [ "NOTIFICATION_ENABLE" ]
179  }
180
181  if (location_feature_with_jsstack) {
182    defines += [ "SUPPORT_JSSTACK" ]
183    external_deps += [ "hiview:libxpower_event_js" ]
184  }
185  relative_install_dir = "module"
186  part_name = "location"
187  subsystem_name = "location"
188}
189