1# Copyright (C) 2022-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("location_common_config") {
18  visibility = [ ":*" ]
19  include_dirs = [ "$LOCATION_ROOT_DIR/interfaces/inner_api/include" ]
20}
21
22local_base_sources = [
23  "$LOCATION_COMMON_DIR/source/app_identity.cpp",
24  "$LOCATION_COMMON_DIR/source/common_hisysevent.cpp",
25  "$LOCATION_COMMON_DIR/source/common_utils.cpp",
26  "$LOCATION_COMMON_DIR/source/geo_address.cpp",
27  "$LOCATION_COMMON_DIR/source/geo_coding_mock_info.cpp",
28  "$LOCATION_COMMON_DIR/source/hook_utils.cpp",
29  "$LOCATION_COMMON_DIR/source/location_data_rdb_helper.cpp",
30  "$LOCATION_COMMON_DIR/source/location_data_rdb_manager.cpp",
31  "$LOCATION_COMMON_DIR/source/location_dumper.cpp",
32  "$LOCATION_COMMON_DIR/source/permission_manager.cpp",
33  "$LOCATION_COMMON_DIR/source/request.cpp",
34  "$LOCATION_COMMON_DIR/source/sa_load_with_statistic.cpp",
35  "$LOCATION_COMMON_DIR/source/ui_extension_ability_connection.cpp",
36  "$LOCATION_ROOT_DIR/frameworks/base_module/source/location.cpp",
37  "$LOCATION_ROOT_DIR/frameworks/base_module/source/request_config.cpp",
38  "$LOCATION_ROOT_DIR/frameworks/base_module/source/satellite_status.cpp",
39]
40
41ohos_shared_library("lbsservice_common") {
42  public_configs = [ ":location_common_config" ]
43
44  sanitize = {
45    cfi = true
46    cfi_cross_dso = true
47    debug = false
48  }
49  branch_protector_ret = "pac_ret"
50
51  sources = local_base_sources
52
53  deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module" ]
54
55  public_external_deps = [
56    "ability_base:zuri",
57    "ability_runtime:extension_manager",
58    "ability_runtime:wantagent_innerkits",
59    "access_token:libaccesstoken_sdk",
60    "access_token:libtokenid_sdk",
61    "c_utils:utils",
62    "data_share:datashare_consumer",
63    "hilog:libhilog",
64    "hisysevent:libhisysevent",
65    "init:libbegetutil",
66    "ipc:ipc_single",
67    "os_account:os_account_innerkits",
68    "samgr:samgr_proxy",
69  ]
70
71  defines = []
72
73  if (is_emulator) {
74    defines += [ "EMULATOR_ENABLED" ]
75  }
76
77  ldflags = [
78    "-Wl,--as-needed",
79    "-Wl,--gc-sections",
80  ]
81
82  cflags_cc = [
83    "-ffunction-sections",
84    "-fdata-sections",
85    "-flto=thin",
86    "-Os",
87  ]
88
89  # Used to control the export of dynamic library symbols.
90  version_script = "liblbsservice_common_version_script.txt"
91
92  innerapi_tags = [ "platformsdk" ]
93  part_name = "location"
94  subsystem_name = "location"
95}
96
97ohos_static_library("lbsservice_common_static") {
98  public_configs = [ ":location_common_config" ]
99
100  sanitize = {
101    cfi = true
102    cfi_cross_dso = true
103    debug = false
104  }
105  branch_protector_ret = "pac_ret"
106
107  sources = local_base_sources
108
109  deps = [ "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module" ]
110
111  public_external_deps = [
112    "ability_base:zuri",
113    "ability_runtime:extension_manager",
114    "ability_runtime:wantagent_innerkits",
115    "access_token:libaccesstoken_sdk",
116    "access_token:libtokenid_sdk",
117    "c_utils:utils",
118    "data_share:datashare_consumer",
119    "hilog:libhilog",
120    "hisysevent:libhisysevent",
121    "init:libbegetutil",
122    "ipc:ipc_single",
123    "os_account:os_account_innerkits",
124    "samgr:samgr_proxy",
125  ]
126
127  defines = []
128
129  if (is_emulator) {
130    defines += [ "EMULATOR_ENABLED" ]
131  }
132
133  part_name = "location"
134  subsystem_name = "location"
135}
136