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 17config("location_common_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ "$LOCATION_ROOT_DIR/interfaces/inner_api/include" ] 20} 21 22local_base_sources = [ 23 "$LOCATION_COMMON_DIR/source/app_identity.cpp", 24 "$LOCATION_COMMON_DIR/source/beacon_fence_request.cpp", 25 "$LOCATION_COMMON_DIR/source/beacon_fence.cpp", 26 "$LOCATION_COMMON_DIR/source/bluetooth_scan_result.cpp", 27 "$LOCATION_COMMON_DIR/source/common_hisysevent.cpp", 28 "$LOCATION_COMMON_DIR/source/common_utils.cpp", 29 "$LOCATION_COMMON_DIR/source/geo_address.cpp", 30 "$LOCATION_COMMON_DIR/source/geocode_convert_address_request.cpp", 31 "$LOCATION_COMMON_DIR/source/geocode_convert_location_request.cpp", 32 "$LOCATION_COMMON_DIR/source/geocoding_mock_info.cpp", 33 "$LOCATION_COMMON_DIR/source/hook_utils.cpp", 34 "$LOCATION_COMMON_DIR/source/location_data_rdb_helper.cpp", 35 "$LOCATION_COMMON_DIR/source/location_data_rdb_manager.cpp", 36 "$LOCATION_COMMON_DIR/source/location_dumper.cpp", 37 "$LOCATION_COMMON_DIR/source/permission_manager.cpp", 38 "$LOCATION_COMMON_DIR/source/proxy_freeze_manager.cpp", 39 "$LOCATION_COMMON_DIR/source/request.cpp", 40 "$LOCATION_COMMON_DIR/source/sa_load_with_statistic.cpp", 41 "$LOCATION_COMMON_DIR/source/ui_extension_ability_connection.cpp", 42 "$LOCATION_ROOT_DIR/frameworks/base_module/source/location.cpp", 43 "$LOCATION_ROOT_DIR/frameworks/base_module/source/request_config.cpp", 44 "$LOCATION_ROOT_DIR/frameworks/base_module/source/satellite_status.cpp", 45] 46 47ohos_shared_library("lbsservice_common") { 48 public_configs = [ 49 ":location_common_config", 50 "$LOCATION_NATIVE_DIR/locator_sdk:locator_interface_config", 51 ] 52 53 sanitize = { 54 cfi = true 55 cfi_cross_dso = true 56 debug = false 57 } 58 branch_protector_ret = "pac_ret" 59 60 sources = local_base_sources 61 62 deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module" ] 63 64 public_external_deps = [ 65 "ability_base:zuri", 66 "ability_runtime:extension_manager", 67 "ability_runtime:wantagent_innerkits", 68 "access_token:libaccesstoken_sdk", 69 "access_token:libtokenid_sdk", 70 "c_utils:utils", 71 "data_share:datashare_consumer", 72 "hilog:libhilog", 73 "hisysevent:libhisysevent", 74 "init:libbegetutil", 75 "ipc:ipc_single", 76 "os_account:os_account_innerkits", 77 "samgr:samgr_proxy", 78 ] 79 80 defines = [] 81 82 if (is_emulator) { 83 defines += [ "EMULATOR_ENABLED" ] 84 } 85 86 ldflags = [ 87 "-Wl,--as-needed", 88 "-Wl,--gc-sections", 89 ] 90 91 cflags_cc = [ 92 "-ffunction-sections", 93 "-fdata-sections", 94 "-flto=thin", 95 "-Os", 96 ] 97 98 # Used to control the export of dynamic library symbols. 99 version_script = "liblbsservice_common_version_script.txt" 100 101 innerapi_tags = [ "platformsdk" ] 102 part_name = "location" 103 subsystem_name = "location" 104} 105 106ohos_static_library("lbsservice_common_static") { 107 public_configs = [ 108 ":location_common_config", 109 "$LOCATION_NATIVE_DIR/locator_sdk:locator_interface_config", 110 ] 111 112 sanitize = { 113 cfi = true 114 cfi_cross_dso = true 115 debug = false 116 } 117 branch_protector_ret = "pac_ret" 118 119 sources = local_base_sources 120 121 deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module" ] 122 123 public_external_deps = [ 124 "ability_base:zuri", 125 "ability_runtime:extension_manager", 126 "ability_runtime:wantagent_innerkits", 127 "access_token:libaccesstoken_sdk", 128 "access_token:libtokenid_sdk", 129 "c_utils:utils", 130 "data_share:datashare_consumer", 131 "hilog:libhilog", 132 "hisysevent:libhisysevent", 133 "init:libbegetutil", 134 "ipc:ipc_single", 135 "os_account:os_account_innerkits", 136 "samgr:samgr_proxy", 137 ] 138 139 defines = [] 140 141 if (is_emulator) { 142 defines += [ "EMULATOR_ENABLED" ] 143 } 144 145 part_name = "location" 146 subsystem_name = "location" 147} 148