• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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
17local_base_sources = [
18  "$LOCATION_LOCATOR_ROOT/source/location_config_manager.cpp",
19  "$LOCATION_LOCATOR_ROOT/source/subability_common.cpp",
20  "$LOCATION_LOCATOR_ROOT/source/work_record.cpp",
21  "$LOCATION_NETWORK_ROOT/source/network_ability.cpp",
22  "$LOCATION_NETWORK_ROOT/source/network_ability_skeleton.cpp",
23  "$LOCATION_NETWORK_ROOT/source/network_callback_host.cpp",
24]
25
26if (location_feature_with_network) {
27  ohos_shared_library("lbsservice_network") {
28    sources = local_base_sources
29
30    include_dirs = [
31      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
32      "$LOCATION_LOCATOR_ROOT/include",
33      "$LOCATION_NETWORK_ROOT/include",
34    ]
35
36    sanitize = {
37      cfi = true
38      cfi_cross_dso = true
39      debug = false
40    }
41    branch_protector_ret = "pac_ret"
42
43    deps = [
44      "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
45      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
46    ]
47
48    external_deps = [
49      "ability_base:want",
50      "ability_runtime:ability_manager",
51      "eventhandler:libeventhandler",
52      "ffrt:libffrt",
53      "hilog:libhilog",
54      "ipc:ipc_single",
55      "safwk:system_ability_fwk",
56    ]
57
58    defines = []
59
60    ldflags = [
61      "-Wl,--as-needed",
62      "-Wl,--gc-sections",
63    ]
64
65    cflags_cc = [
66      "-ffunction-sections",
67      "-fdata-sections",
68      "-Os",
69    ]
70
71    if (location_feature_with_network) {
72      defines += [ "FEATURE_NETWORK_SUPPORT" ]
73    }
74
75    if (location_feature_with_passive) {
76      defines += [ "FEATURE_PASSIVE_SUPPORT" ]
77    }
78
79    if (location_hicollie_enable) {
80      external_deps += [ "hicollie:libhicollie" ]
81      defines += [ "LOCATION_HICOLLIE_ENABLE" ]
82    }
83
84    # Used to control the export of dynamic library symbols.
85    version_script = "liblbsservice_network_version_script.txt"
86
87    part_name = "location"
88    subsystem_name = "location"
89  }
90
91  ohos_static_library("lbsservice_network_static") {
92    sources = local_base_sources
93
94    include_dirs = [
95      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
96      "$LOCATION_LOCATOR_ROOT/include",
97      "$LOCATION_NETWORK_ROOT/include",
98    ]
99
100    sanitize = {
101      cfi = true
102      cfi_cross_dso = true
103      debug = false
104    }
105    branch_protector_ret = "pac_ret"
106
107    deps = [
108      "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
109      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
110    ]
111
112    external_deps = [
113      "ability_base:want",
114      "ability_runtime:ability_manager",
115      "eventhandler:libeventhandler",
116      "ffrt:libffrt",
117      "hilog:libhilog",
118      "ipc:ipc_single",
119      "safwk:system_ability_fwk",
120    ]
121
122    defines = []
123    if (location_feature_with_network) {
124      defines += [ "FEATURE_NETWORK_SUPPORT" ]
125    }
126
127    if (location_feature_with_passive) {
128      defines += [ "FEATURE_PASSIVE_SUPPORT" ]
129    }
130
131    if (location_hicollie_enable) {
132      external_deps += [ "hicollie:libhicollie" ]
133      defines += [ "LOCATION_HICOLLIE_ENABLE" ]
134    }
135
136    part_name = "location"
137    subsystem_name = "location"
138  }
139} else {
140  ohos_shared_library("lbsservice_network") {
141    part_name = "location"
142    subsystem_name = "location"
143  }
144
145  ohos_static_library("lbsservice_network_static") {
146    part_name = "location"
147    subsystem_name = "location"
148  }
149}
150