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