# Copyright (C) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/location/config.gni") import("//build/ohos.gni") local_base_sources = [ "$LOCATION_ROOT_DIR/frameworks/js/napi/source/cached_locations_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/country_code_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/geofence_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/gnss_status_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/locating_required_data_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_error_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_gnss_geofence_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_adapter.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_entry.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_errcode.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_event.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_napi_system.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/location_switch_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/locator_callback_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/napi_util.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/source/nmea_message_callback_napi.cpp", ] if (notification_distributed_notification_service_enable) { local_notification_sources = [ "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_content.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_liveview.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_notification.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_convert_request.cpp", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/src/notification_napi_utils.cpp", ] notification_external_deps = [ "ability_base:session_info", "ability_base:want", "ability_runtime:napi_common", "distributed_notification_service:ans_innerkits", "image_framework:image", "relational_store:native_rdb", ] } ohos_shared_library("geolocation") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" install_enable = true include_dirs = [ "$LOCATION_ROOT_DIR/frameworks/js/napi/include", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include", "$LOCATION_ROOT_DIR/interfaces/inner_api/include", ] sources = local_base_sources deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk", "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk", ] external_deps = [ "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", ] defines = [] if (notification_distributed_notification_service_enable) { sources += local_notification_sources external_deps += notification_external_deps defines += [ "NOTIFICATION_ENABLE" ] } if (location_feature_with_jsstack) { defines += [ "SUPPORT_JSSTACK" ] external_deps += [ "hiview:libxpower_event_js" ] } relative_install_dir = "module" part_name = "location" subsystem_name = "location" } ohos_static_library("geolocation_static") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "$LOCATION_ROOT_DIR/frameworks/js/napi/include", "$LOCATION_ROOT_DIR/interfaces/inner_api/include", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include", ] sources = local_base_sources deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk", "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk", ] external_deps = [ "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", ] defines = [] if (notification_distributed_notification_service_enable) { sources += local_notification_sources external_deps += notification_external_deps defines += [ "NOTIFICATION_ENABLE" ] } part_name = "location" subsystem_name = "location" } ohos_shared_library("geolocationmanager") { install_enable = true sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" include_dirs = [ "$LOCATION_ROOT_DIR/frameworks/js/napi/include", "$LOCATION_ROOT_DIR/interfaces/inner_api/include", "$LOCATION_ROOT_DIR/frameworks/js/napi/notification/include", ] sources = local_base_sources deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", "$LOCATION_ROOT_DIR/frameworks/native/geofence_sdk:geofence_sdk", "$LOCATION_ROOT_DIR/frameworks/native/locator_sdk:locator_sdk", ] defines = [ "ENABLE_NAPI_MANAGER" ] external_deps = [ "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", ] if (notification_distributed_notification_service_enable) { sources += local_notification_sources external_deps += notification_external_deps defines += [ "NOTIFICATION_ENABLE" ] } if (location_feature_with_jsstack) { defines += [ "SUPPORT_JSSTACK" ] external_deps += [ "hiview:libxpower_event_js" ] } relative_install_dir = "module" part_name = "location" subsystem_name = "location" }