1# Copyright (C) 2023 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("locator_agent_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "$LOCATION_ROOT_DIR/interfaces/inner_api/native/include", 21 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 22 "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/include", 23 "$LOCATION_ROOT_DIR/frameworks/base_module/include", 24 ] 25} 26 27ohos_shared_library("locator_agent") { 28 public_configs = [ 29 ":locator_agent_config", 30 "$LOCATION_NATIVE_DIR/locator_sdk:locator_interface_config", 31 ] 32 33 sources = [ 34 "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/locator_agent.cpp", 35 "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_location_callback_host.cpp", 36 "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_nmea_callback_host.cpp", 37 "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_sv_callback_host.cpp", 38 ] 39 40 sanitize = { 41 cfi = true 42 cfi_cross_dso = true 43 debug = false 44 } 45 46 branch_protector_ret = "pac_ret" 47 48 deps = [ 49 "$LOCATION_COMMON_DIR:lbsservice_common", 50 "$LOCATION_NATIVE_DIR/locator_sdk:liblocator_interface_proxy", 51 "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module", 52 ] 53 54 external_deps = [ 55 "c_utils:utils", 56 "hilog:libhilog", 57 "ipc:ipc_single", 58 "samgr:samgr_proxy", 59 ] 60 61 ldflags = [ 62 "-Wl,--as-needed", 63 "-Wl,--gc-sections", 64 ] 65 66 cflags_cc = [ 67 "-ffunction-sections", 68 "-fdata-sections", 69 ] 70 71 defines = [] 72 if (is_emulator) { 73 defines += [ "EMULATOR_ENABLED" ] 74 } 75 76 innerapi_tags = [ "platformsdk" ] 77 part_name = "location" 78 subsystem_name = "location" 79} 80