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