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