• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2024 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("geofence_sdk_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
21    "$LOCATION_ROOT_DIR/frameworks/js/napi/include",
22    "$LOCATION_ROOT_DIR/frameworks/native/notification/include",
23  ]
24}
25
26local_base_sources = [
27  "$LOCATION_NATIVE_DIR/geofence_sdk/source/geofence_request.cpp",
28  "$LOCATION_NATIVE_DIR/geofence_sdk/source/geofence_sdk.cpp",
29]
30
31ohos_shared_library("geofence_sdk") {
32  install_enable = true
33
34  public_configs = [ ":geofence_sdk_config" ]
35
36  sanitize = {
37    cfi = true
38    cfi_cross_dso = true
39    debug = false
40  }
41  branch_protector_ret = "pac_ret"
42
43  sources = local_base_sources
44
45  deps = [
46    "$LOCATION_COMMON_DIR:lbsservice_common",
47    "$LOCATION_NATIVE_DIR/locator_sdk:liblocator_interface_proxy",
48    "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
49  ]
50
51  public_external_deps = [
52    "hilog:libhilog",
53    "init:libbegetutil",
54    "ipc:ipc_single",
55    "samgr:samgr_proxy",
56  ]
57
58  defines = []
59
60  if (notification_distributed_notification_service_enable) {
61    public_external_deps += [ "distributed_notification_service:ans_innerkits" ]
62    defines += [ "NOTIFICATION_ENABLE" ]
63  }
64
65  if (is_emulator) {
66    defines += [ "EMULATOR_ENABLED" ]
67  }
68
69  cflags_cc = [
70    "-std=c++17",
71    "-fno-rtti",
72    "-ffunction-sections",
73    "-fdata-sections",
74    "-Os",
75  ]
76
77  ldflags = [
78    "-fPIC",
79    "-Wl,-E",
80    "-Wl,--as-needed",
81    "-Wl,--gc-sections",
82  ]
83
84  # Used to control the export of dynamic library symbols.
85  version_script = "libgeofence_sdk_version_script.txt"
86
87  innerapi_tags = [ "platformsdk" ]
88  part_name = "location"
89  subsystem_name = "location"
90}
91
92ohos_static_library("geofence_sdk_static") {
93  public_configs = [ ":geofence_sdk_config" ]
94
95  sanitize = {
96    cfi = true
97    cfi_cross_dso = true
98    debug = false
99  }
100  branch_protector_ret = "pac_ret"
101
102  sources = local_base_sources
103
104  deps = [
105    "$LOCATION_COMMON_DIR:lbsservice_common",
106    "$LOCATION_NATIVE_DIR/locator_sdk:liblocator_interface_proxy",
107    "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
108  ]
109
110  public_external_deps = [
111    "hilog:libhilog",
112    "init:libbegetutil",
113    "ipc:ipc_single",
114    "samgr:samgr_proxy",
115  ]
116
117  defines = []
118
119  if (notification_distributed_notification_service_enable) {
120    public_external_deps += [ "distributed_notification_service:ans_innerkits" ]
121    defines += [ "NOTIFICATION_ENABLE" ]
122  }
123
124  if (is_emulator) {
125    defines += [ "EMULATOR_ENABLED" ]
126  }
127
128  cflags_cc = [
129    "-std=c++17",
130    "-fno-rtti",
131  ]
132
133  ldflags = [
134    "-fPIC",
135    "-Wl,-E",
136  ]
137
138  part_name = "location"
139  subsystem_name = "location"
140}
141