• 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/location_common/common:lbsservice_common",
43    ]
44
45    ldflags = [
46      "-Wl,--as-needed",
47      "-Wl,--gc-sections",
48    ]
49
50    cflags_cc = [
51      "-ffunction-sections",
52      "-fdata-sections",
53      "-Os",
54    ]
55
56    defines = []
57    if (location_feature_with_geocode) {
58      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
59    }
60
61    external_deps = [
62      "ability_base:want",
63      "ability_runtime:ability_manager",
64      "eventhandler:libeventhandler",
65      "ffrt:libffrt",
66      "hilog:libhilog",
67      "ipc:ipc_single",
68      "safwk:system_ability_fwk",
69    ]
70
71    # Used to control the export of dynamic library symbols.
72    version_script = "liblbsservice_geocode_version_script.txt"
73
74    part_name = "location"
75    subsystem_name = "location"
76  }
77
78  ohos_static_library("lbsservice_geocode_static") {
79    sources = local_base_sources
80
81    include_dirs = [
82      "$LOCATION_GEOCONVERT_ROOT/include",
83      "$LOCATION_LOCATOR_ROOT/include",
84      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
85    ]
86
87    sanitize = {
88      cfi = true
89      cfi_cross_dso = true
90      debug = false
91    }
92    branch_protector_ret = "pac_ret"
93
94    deps = [
95      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
96    ]
97
98    ldflags = [
99      "-Wl,--as-needed",
100      "-Wl,--gc-sections",
101    ]
102
103    cflags_cc = [
104      "-ffunction-sections",
105      "-fdata-sections",
106    ]
107
108    defines = []
109    if (location_feature_with_geocode) {
110      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
111    }
112
113    external_deps = [
114      "ability_base:want",
115      "ability_runtime:ability_manager",
116      "ffrt:libffrt",
117      "hilog:libhilog",
118      "ipc:ipc_single",
119      "safwk:system_ability_fwk",
120    ]
121
122    part_name = "location"
123    subsystem_name = "location"
124  }
125} else {
126  ohos_shared_library("lbsservice_geocode") {
127    part_name = "location"
128    subsystem_name = "location"
129  }
130
131  ohos_static_library("lbsservice_geocode_static") {
132    part_name = "location"
133    subsystem_name = "location"
134  }
135}
136