1# Copyright (c) 2022-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.
13import("//build/ohos.gni")
14import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
15import("../../location.gni")
16
17ohos_shared_library("libgeofence_interface_service_2.0") {
18  include_dirs = [
19    "${location_driver_path}/geofence/hdi_service",
20    "${location_driver_path}/gnss/hdi_service",
21  ]
22  sources = [ "geofence_interface_impl.cpp" ]
23
24  sanitize = {
25    cfi = true
26    cfi_cross_dso = true
27    debug = false
28  }
29  branch_protector_ret = "pac_ret"
30
31  deps = []
32
33  cflags = [
34    "-Wall",
35    "-Wextra",
36    "-Werror",
37    "-fsigned-char",
38    "-fno-common",
39    "-fno-strict-aliasing",
40  ]
41
42  if (is_standard_system) {
43    external_deps = [
44      "c_utils:utils",
45      "drivers_interface_location_geofence:location_geofence_idl_headers",
46      "hilog:libhilog",
47      "ipc:ipc_single",
48    ]
49  } else {
50    external_deps = [
51      "hilog:libhilog",
52      "ipc:ipc_single",
53    ]
54  }
55
56  install_images = [ chipset_base_dir ]
57  subsystem_name = "hdf"
58  part_name = "drivers_peripheral_location_geofence"
59}
60
61ohos_shared_library("liblocation_geofence_hdi_driver") {
62  include_dirs = [ "${location_driver_path}/geofence/hdi_service" ]
63
64  sources = [ "geofence_interface_driver.cpp" ]
65
66  cflags = [
67    "-Wall",
68    "-Wextra",
69    "-Werror",
70    "-fsigned-char",
71    "-fno-common",
72    "-fno-strict-aliasing",
73  ]
74
75  if (is_standard_system) {
76    external_deps = [
77      "c_utils:utils",
78      "hdf_core:libhdf_host",
79      "hdf_core:libhdf_ipc_adapter",
80      "hdf_core:libhdf_utils",
81      "hdf_core:libhdi",
82      "hilog:libhilog",
83      "ipc:ipc_single",
84    ]
85  } else {
86    external_deps = [
87      "hilog:libhilog",
88      "ipc:ipc_single",
89    ]
90  }
91
92  external_deps +=
93      [ "drivers_interface_location_geofence:liblocation_geofence_stub_2.0" ]
94
95  shlib_type = "hdi"
96  install_images = [ chipset_base_dir ]
97  subsystem_name = "hdf"
98  part_name = "drivers_peripheral_location_geofence"
99}
100
101group("hdi_location_geofence_service") {
102  deps = [
103    ":libgeofence_interface_service_2.0",
104    ":liblocation_geofence_hdi_driver",
105  ]
106}
107