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 = [ ":locator_agent_config" ]
29
30  sources = [
31    "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/locator_agent.cpp",
32    "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_location_callback_host.cpp",
33    "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_nmea_callback_host.cpp",
34    "$LOCATION_ROOT_DIR/frameworks/native/locator_agent/source/native_sv_callback_host.cpp",
35  ]
36
37  sanitize = {
38    cfi = true
39    cfi_cross_dso = true
40    debug = false
41  }
42
43  branch_protector_ret = "pac_ret"
44
45  deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module" ]
46
47  external_deps = [
48    "c_utils:utils",
49    "hilog:libhilog",
50    "ipc:ipc_single",
51    "samgr:samgr_proxy",
52  ]
53
54  ldflags = [
55    "-Wl,--as-needed",
56    "-Wl,--gc-sections",
57  ]
58
59  cflags_cc = [
60    "-ffunction-sections",
61    "-fdata-sections",
62  ]
63
64  defines = []
65  if (is_emulator) {
66    defines += [ "EMULATOR_ENABLED" ]
67  }
68
69  innerapi_tags = [ "platformsdk" ]
70  part_name = "location"
71  subsystem_name = "location"
72}
73