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