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