• 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      "json:nlohmann_json_static",
70      "safwk:system_ability_fwk",
71    ]
72
73    if (location_hicollie_enable) {
74      external_deps += [ "hicollie:libhicollie" ]
75      defines += [ "LOCATION_HICOLLIE_ENABLE" ]
76    }
77
78    # Used to control the export of dynamic library symbols.
79    version_script = "liblbsservice_geocode_version_script.txt"
80
81    part_name = "location"
82    subsystem_name = "location"
83  }
84
85  ohos_static_library("lbsservice_geocode_static") {
86    sources = local_base_sources
87
88    include_dirs = [
89      "$LOCATION_GEOCONVERT_ROOT/include",
90      "$LOCATION_LOCATOR_ROOT/include",
91      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
92    ]
93
94    sanitize = {
95      cfi = true
96      cfi_cross_dso = true
97      debug = false
98    }
99    branch_protector_ret = "pac_ret"
100
101    deps = [
102      "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
103      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
104    ]
105
106    ldflags = [
107      "-Wl,--as-needed",
108      "-Wl,--gc-sections",
109    ]
110
111    cflags_cc = [
112      "-ffunction-sections",
113      "-fdata-sections",
114    ]
115
116    defines = []
117    if (location_feature_with_geocode) {
118      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
119    }
120
121    external_deps = [
122      "ability_base:want",
123      "ability_runtime:ability_manager",
124      "ffrt:libffrt",
125      "hilog:libhilog",
126      "ipc:ipc_single",
127      "json:nlohmann_json_static",
128      "safwk:system_ability_fwk",
129    ]
130
131    if (location_hicollie_enable) {
132      external_deps += [ "hicollie:libhicollie" ]
133      defines += [ "LOCATION_HICOLLIE_ENABLE" ]
134    }
135
136    defines += [ "TDD_CASES_ENABLED" ]
137
138    part_name = "location"
139    subsystem_name = "location"
140  }
141} else {
142  ohos_shared_library("lbsservice_geocode") {
143    part_name = "location"
144    subsystem_name = "location"
145  }
146
147  ohos_static_library("lbsservice_geocode_static") {
148    part_name = "location"
149    subsystem_name = "location"
150  }
151}
152