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 17local_base_sources = [ 18 "$LOCATION_LOCATOR_ROOT/source/location_config_manager.cpp", 19 "$LOCATION_LOCATOR_ROOT/source/subability_common.cpp", 20 "$LOCATION_LOCATOR_ROOT/source/work_record.cpp", 21 "$LOCATION_NETWORK_ROOT/source/network_ability.cpp", 22 "$LOCATION_NETWORK_ROOT/source/network_ability_skeleton.cpp", 23 "$LOCATION_NETWORK_ROOT/source/network_callback_host.cpp", 24] 25 26if (location_feature_with_network) { 27 ohos_shared_library("lbsservice_network") { 28 sources = local_base_sources 29 30 include_dirs = [ 31 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 32 "$LOCATION_LOCATOR_ROOT/include", 33 "$LOCATION_NETWORK_ROOT/include", 34 ] 35 36 sanitize = { 37 cfi = true 38 cfi_cross_dso = true 39 debug = false 40 } 41 branch_protector_ret = "pac_ret" 42 43 deps = [ 44 "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", 45 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", 46 ] 47 48 external_deps = [ 49 "ability_base:want", 50 "ability_runtime:ability_manager", 51 "eventhandler:libeventhandler", 52 "ffrt:libffrt", 53 "hilog:libhilog", 54 "ipc:ipc_single", 55 "json:nlohmann_json_static", 56 "safwk:system_ability_fwk", 57 ] 58 59 defines = [] 60 61 ldflags = [ 62 "-Wl,--as-needed", 63 "-Wl,--gc-sections", 64 ] 65 66 cflags_cc = [ 67 "-ffunction-sections", 68 "-fdata-sections", 69 "-Os", 70 ] 71 72 if (location_feature_with_network) { 73 defines += [ "FEATURE_NETWORK_SUPPORT" ] 74 } 75 76 if (location_feature_with_passive) { 77 defines += [ "FEATURE_PASSIVE_SUPPORT" ] 78 } 79 80 if (location_hicollie_enable) { 81 external_deps += [ "hicollie:libhicollie" ] 82 defines += [ "LOCATION_HICOLLIE_ENABLE" ] 83 } 84 85 # Used to control the export of dynamic library symbols. 86 version_script = "liblbsservice_network_version_script.txt" 87 88 part_name = "location" 89 subsystem_name = "location" 90 } 91 92 ohos_static_library("lbsservice_network_static") { 93 sources = local_base_sources 94 95 include_dirs = [ 96 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 97 "$LOCATION_LOCATOR_ROOT/include", 98 "$LOCATION_NETWORK_ROOT/include", 99 ] 100 101 sanitize = { 102 cfi = true 103 cfi_cross_dso = true 104 debug = false 105 } 106 branch_protector_ret = "pac_ret" 107 108 deps = [ 109 "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", 110 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", 111 ] 112 113 external_deps = [ 114 "ability_base:want", 115 "ability_runtime:ability_manager", 116 "eventhandler:libeventhandler", 117 "ffrt:libffrt", 118 "hilog:libhilog", 119 "ipc:ipc_single", 120 "json:nlohmann_json_static", 121 "safwk:system_ability_fwk", 122 ] 123 124 defines = [] 125 if (location_feature_with_network) { 126 defines += [ "FEATURE_NETWORK_SUPPORT" ] 127 } 128 129 if (location_feature_with_passive) { 130 defines += [ "FEATURE_PASSIVE_SUPPORT" ] 131 } 132 133 if (location_hicollie_enable) { 134 external_deps += [ "hicollie:libhicollie" ] 135 defines += [ "LOCATION_HICOLLIE_ENABLE" ] 136 } 137 defines += [ "TDD_CASES_ENABLED" ] 138 part_name = "location" 139 subsystem_name = "location" 140 } 141} else { 142 ohos_shared_library("lbsservice_network") { 143 part_name = "location" 144 subsystem_name = "location" 145 } 146 147 ohos_static_library("lbsservice_network_static") { 148 part_name = "location" 149 subsystem_name = "location" 150 } 151} 152