• 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/native/notification/include",
22    "$LOCATION_ROOT_DIR/frameworks/js/napi/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 = [ "$LOCATION_COMMON_DIR:lbsservice_common" ]
46
47  public_external_deps = [
48    "hilog:libhilog",
49    "init:libbegetutil",
50    "ipc:ipc_single",
51    "samgr:samgr_proxy",
52  ]
53
54  defines = []
55
56  if (notification_distributed_notification_service_enable) {
57    public_external_deps += [ "distributed_notification_service:ans_innerkits" ]
58    defines += [ "NOTIFICATION_ENABLE" ]
59  }
60
61  if (is_emulator) {
62    defines += [ "EMULATOR_ENABLED" ]
63  }
64
65  cflags_cc = [
66    "-std=c++17",
67    "-fno-rtti",
68    "-ffunction-sections",
69    "-fdata-sections",
70    "-Os",
71  ]
72
73  ldflags = [
74    "-fPIC",
75    "-Wl,-E",
76    "-Wl,--as-needed",
77    "-Wl,--gc-sections",
78  ]
79
80  # Used to control the export of dynamic library symbols.
81  version_script = "libgeofence_sdk_version_script.txt"
82
83  innerapi_tags = [ "platformsdk" ]
84  part_name = "location"
85  subsystem_name = "location"
86}
87
88ohos_static_library("geofence_sdk_static") {
89  public_configs = [ ":geofence_sdk_config" ]
90
91  sanitize = {
92    cfi = true
93    cfi_cross_dso = true
94    debug = false
95  }
96  branch_protector_ret = "pac_ret"
97
98  sources = local_base_sources
99
100  deps = [ "$LOCATION_COMMON_DIR:lbsservice_common" ]
101
102  public_external_deps = [
103    "hilog:libhilog",
104    "init:libbegetutil",
105    "ipc:ipc_single",
106    "samgr:samgr_proxy",
107  ]
108
109  defines = []
110
111  if (notification_distributed_notification_service_enable) {
112    public_external_deps += [ "distributed_notification_service:ans_innerkits" ]
113    defines += [ "NOTIFICATION_ENABLE" ]
114  }
115
116  if (is_emulator) {
117    defines += [ "EMULATOR_ENABLED" ]
118  }
119
120  cflags_cc = [
121    "-std=c++17",
122    "-fno-rtti",
123  ]
124
125  ldflags = [
126    "-fPIC",
127    "-Wl,-E",
128  ]
129
130  part_name = "location"
131  subsystem_name = "location"
132}
133