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("fence_extension_ability_config") { 18 visibility = [ ":*" ] 19 include_dirs = [ 20 "$LOCATION_NATIVE_DIR/fence_extension_ability/include", 21 "$LOCATION_ROOT_DIR/interfaces/inner_api/include", 22 ] 23} 24 25fence_extension_ability_sources = [ 26 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/fence_extension.cpp", 27 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/fence_extension_context.cpp", 28 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/fence_extension_module_loader.cpp", 29 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/fence_extension_stub.cpp", 30 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/fence_extension_stub_impl.cpp", 31 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/js_fence_extension.cpp", 32 "$LOCATION_NATIVE_DIR/fence_extension_ability/src/js_fence_extension_context.cpp", 33] 34 35fence_extension_ability_deps = [ 36 "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation", 37 "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common", 38] 39 40fence_extension_ability_external_deps = [ 41 "ability_base:want", 42 "ability_runtime:ability_context_native", 43 "ability_runtime:ability_manager", 44 "ability_runtime:app_context", 45 "ability_runtime:extensionkit_native", 46 "ability_runtime:napi_common", 47 "ability_runtime:runtime", 48 "access_token:libaccesstoken_sdk", 49 "access_token:libprivacy_sdk", 50 "c_utils:utils", 51 "eventhandler:libeventhandler", 52 "ffrt:libffrt", 53 "hilog:libhilog", 54 "ipc:ipc_single", 55 "napi:ace_napi", 56 "os_account:os_account_innerkits", 57 "safwk:system_ability_fwk", 58 "samgr:samgr_proxy", 59] 60 61ohos_shared_library("fence_extension_ability") { 62 public_configs = [ ":fence_extension_ability_config" ] 63 64 sources = fence_extension_ability_sources 65 66 public_deps = fence_extension_ability_deps 67 68 external_deps = fence_extension_ability_external_deps 69 70 relative_install_dir = "extensionability/" 71 72 subsystem_name = "location" 73 74 part_name = "location" 75 sanitize = { 76 cfi = true 77 cfi_cross_dso = true 78 debug = false 79 } 80 81 cflags_cc = [ 82 "-std=c++17", 83 "-fno-rtti", 84 ] 85 86 ldflags = [ 87 "-fPIC", 88 "-Wl,-E", 89 ] 90 91 branch_protector_ret = "pac_ret" 92} 93 94# Just for test. 95ohos_static_library("fence_extension_ability_static") { 96 public_configs = [ ":fence_extension_ability_config" ] 97 98 sources = fence_extension_ability_sources 99 100 public_deps = fence_extension_ability_deps 101 102 external_deps = fence_extension_ability_external_deps 103 104 subsystem_name = "location" 105 106 part_name = "location" 107 sanitize = { 108 cfi = true 109 cfi_cross_dso = true 110 debug = false 111 } 112 cflags_cc = [ 113 "-std=c++17", 114 "-fno-rtti", 115 ] 116 117 ldflags = [ 118 "-fPIC", 119 "-Wl,-E", 120 ] 121} 122