1# Copyright (C) 2022 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 17################################################################################ 18 19config("locator_sdk_config") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 23 "$LOCATION_ROOT_DIR/frameworks/js/napi/include", 24 ] 25} 26 27ohos_shared_library("locator_sdk") { 28 install_enable = true 29 30 public_configs = [ ":locator_sdk_config" ] 31 32 sources = [ 33 "$LOCATION_COMMON_DIR/source/geo_address.cpp", 34 "$LOCATION_COMMON_DIR/source/geo_coding_mock_info.cpp", 35 "$LOCATION_COMMON_DIR/source/location.cpp", 36 "$LOCATION_COMMON_DIR/source/request_config.cpp", 37 "$LOCATION_COMMON_DIR/source/satellite_status.cpp", 38 "$LOCATION_NATIVE_DIR/source/cached_locations_callback_host.cpp", 39 "$LOCATION_NATIVE_DIR/source/country_code_callback_host.cpp", 40 "$LOCATION_NATIVE_DIR/source/country_code_manager.cpp", 41 "$LOCATION_NATIVE_DIR/source/fence_impl.cpp", 42 "$LOCATION_NATIVE_DIR/source/gnss_status_callback_host.cpp", 43 "$LOCATION_NATIVE_DIR/source/locating_required_data_callback_host.cpp", 44 "$LOCATION_NATIVE_DIR/source/location_data_manager.cpp", 45 "$LOCATION_NATIVE_DIR/source/location_data_rdb_observer.cpp", 46 "$LOCATION_NATIVE_DIR/source/location_switch_callback_host.cpp", 47 "$LOCATION_NATIVE_DIR/source/locator.cpp", 48 "$LOCATION_NATIVE_DIR/source/locator_callback_host.cpp", 49 "$LOCATION_NATIVE_DIR/source/locator_impl.cpp", 50 "$LOCATION_NATIVE_DIR/source/locator_proxy.cpp", 51 "$LOCATION_NATIVE_DIR/source/napi_util.cpp", 52 "$LOCATION_NATIVE_DIR/source/nmea_message_callback_host.cpp", 53 "$LOCATION_NATIVE_DIR/source/switch_callback_proxy.cpp", 54 ] 55 56 deps = [ 57 "$LOCATION_COMMON_DIR:lbsservice_common", 58 "//third_party/libuv:uv", 59 ] 60 61 external_deps = [ 62 "ability_base:zuri", 63 "ability_runtime:dataobs_manager", 64 "ability_runtime:wantagent_innerkits", 65 "c_utils:utils", 66 "common_event_service:cesfwk_innerkits", 67 "data_share:datashare_consumer", 68 "hilog:libhilog", 69 "init:libbeget_proxy", 70 "ipc:ipc_single", 71 "napi:ace_napi", 72 "samgr:samgr_proxy", 73 ] 74 75 defines = [] 76 77 if (i18n_enable) { 78 external_deps += [ "i18n:intl_util" ] 79 defines += [ "I18N_ENABLE" ] 80 } 81 82 if (telephony_core_service_enable) { 83 external_deps += [ "core_service:tel_core_service_api" ] 84 defines += [ "TEL_CORE_SERVICE_ENABLE" ] 85 } 86 87 if (telephony_cellular_data_enable) { 88 external_deps += [ "cellular_data:tel_cellular_data_api" ] 89 defines += [ "TEL_CELLULAR_DATA_ENABLE" ] 90 } 91 92 cflags_cc = [ 93 "-std=c++17", 94 "-fno-rtti", 95 ] 96 97 ldflags = [ 98 "-fPIC", 99 "-Wl,-E", 100 ] 101 102 innerapi_tags = [ "platformsdk" ] 103 part_name = "location" 104 subsystem_name = "location" 105} 106