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