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