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