15c735df2Sopenharmony_ci# Copyright (C) 2022 Huawei Device Co., Ltd.
25c735df2Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
35c735df2Sopenharmony_ci# you may not use this file except in compliance with the License.
45c735df2Sopenharmony_ci# You may obtain a copy of the License at
55c735df2Sopenharmony_ci#
65c735df2Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
75c735df2Sopenharmony_ci#
85c735df2Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
95c735df2Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
105c735df2Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
115c735df2Sopenharmony_ci# See the License for the specific language governing permissions and
125c735df2Sopenharmony_ci# limitations under the License.
135c735df2Sopenharmony_ci
145c735df2Sopenharmony_ciimport("//base/location/config.gni")
155c735df2Sopenharmony_ciimport("//build/ohos.gni")
165c735df2Sopenharmony_ci
175c735df2Sopenharmony_cilocal_base_sources = [
185c735df2Sopenharmony_ci  "$LOCATION_GEOCONVERT_ROOT/source/geo_convert_request.cpp",
195c735df2Sopenharmony_ci  "$LOCATION_GEOCONVERT_ROOT/source/geo_convert_service.cpp",
205c735df2Sopenharmony_ci  "$LOCATION_GEOCONVERT_ROOT/source/geo_convert_skeleton.cpp",
215c735df2Sopenharmony_ci  "$LOCATION_LOCATOR_ROOT/source/location_config_manager.cpp",
225c735df2Sopenharmony_ci]
235c735df2Sopenharmony_ci
245c735df2Sopenharmony_ciif (location_feature_with_geocode) {
255c735df2Sopenharmony_ci  ohos_shared_library("lbsservice_geocode") {
265c735df2Sopenharmony_ci    sources = local_base_sources
275c735df2Sopenharmony_ci
285c735df2Sopenharmony_ci    include_dirs = [
295c735df2Sopenharmony_ci      "$LOCATION_GEOCONVERT_ROOT/include",
305c735df2Sopenharmony_ci      "$LOCATION_LOCATOR_ROOT/include",
315c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
325c735df2Sopenharmony_ci    ]
335c735df2Sopenharmony_ci
345c735df2Sopenharmony_ci    sanitize = {
355c735df2Sopenharmony_ci      cfi = true
365c735df2Sopenharmony_ci      cfi_cross_dso = true
375c735df2Sopenharmony_ci      debug = false
385c735df2Sopenharmony_ci    }
395c735df2Sopenharmony_ci    branch_protector_ret = "pac_ret"
405c735df2Sopenharmony_ci
415c735df2Sopenharmony_ci    deps = [
425c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
435c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
445c735df2Sopenharmony_ci    ]
455c735df2Sopenharmony_ci
465c735df2Sopenharmony_ci    ldflags = [
475c735df2Sopenharmony_ci      "-Wl,--as-needed",
485c735df2Sopenharmony_ci      "-Wl,--gc-sections",
495c735df2Sopenharmony_ci    ]
505c735df2Sopenharmony_ci
515c735df2Sopenharmony_ci    cflags_cc = [
525c735df2Sopenharmony_ci      "-ffunction-sections",
535c735df2Sopenharmony_ci      "-fdata-sections",
545c735df2Sopenharmony_ci      "-Os",
555c735df2Sopenharmony_ci    ]
565c735df2Sopenharmony_ci
575c735df2Sopenharmony_ci    defines = []
585c735df2Sopenharmony_ci    if (location_feature_with_geocode) {
595c735df2Sopenharmony_ci      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
605c735df2Sopenharmony_ci    }
615c735df2Sopenharmony_ci
625c735df2Sopenharmony_ci    external_deps = [
635c735df2Sopenharmony_ci      "ability_base:want",
645c735df2Sopenharmony_ci      "ability_runtime:ability_manager",
655c735df2Sopenharmony_ci      "eventhandler:libeventhandler",
665c735df2Sopenharmony_ci      "ffrt:libffrt",
675c735df2Sopenharmony_ci      "hilog:libhilog",
685c735df2Sopenharmony_ci      "ipc:ipc_single",
695c735df2Sopenharmony_ci      "safwk:system_ability_fwk",
705c735df2Sopenharmony_ci    ]
715c735df2Sopenharmony_ci
725c735df2Sopenharmony_ci    # Used to control the export of dynamic library symbols.
735c735df2Sopenharmony_ci    version_script = "liblbsservice_geocode_version_script.txt"
745c735df2Sopenharmony_ci
755c735df2Sopenharmony_ci    part_name = "location"
765c735df2Sopenharmony_ci    subsystem_name = "location"
775c735df2Sopenharmony_ci  }
785c735df2Sopenharmony_ci
795c735df2Sopenharmony_ci  ohos_static_library("lbsservice_geocode_static") {
805c735df2Sopenharmony_ci    sources = local_base_sources
815c735df2Sopenharmony_ci
825c735df2Sopenharmony_ci    include_dirs = [
835c735df2Sopenharmony_ci      "$LOCATION_GEOCONVERT_ROOT/include",
845c735df2Sopenharmony_ci      "$LOCATION_LOCATOR_ROOT/include",
855c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
865c735df2Sopenharmony_ci    ]
875c735df2Sopenharmony_ci
885c735df2Sopenharmony_ci    sanitize = {
895c735df2Sopenharmony_ci      cfi = true
905c735df2Sopenharmony_ci      cfi_cross_dso = true
915c735df2Sopenharmony_ci      debug = false
925c735df2Sopenharmony_ci    }
935c735df2Sopenharmony_ci    branch_protector_ret = "pac_ret"
945c735df2Sopenharmony_ci
955c735df2Sopenharmony_ci    deps = [
965c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/frameworks/base_module:lbsbase_module",
975c735df2Sopenharmony_ci      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common",
985c735df2Sopenharmony_ci    ]
995c735df2Sopenharmony_ci
1005c735df2Sopenharmony_ci    ldflags = [
1015c735df2Sopenharmony_ci      "-Wl,--as-needed",
1025c735df2Sopenharmony_ci      "-Wl,--gc-sections",
1035c735df2Sopenharmony_ci    ]
1045c735df2Sopenharmony_ci
1055c735df2Sopenharmony_ci    cflags_cc = [
1065c735df2Sopenharmony_ci      "-ffunction-sections",
1075c735df2Sopenharmony_ci      "-fdata-sections",
1085c735df2Sopenharmony_ci    ]
1095c735df2Sopenharmony_ci
1105c735df2Sopenharmony_ci    defines = []
1115c735df2Sopenharmony_ci    if (location_feature_with_geocode) {
1125c735df2Sopenharmony_ci      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
1135c735df2Sopenharmony_ci    }
1145c735df2Sopenharmony_ci
1155c735df2Sopenharmony_ci    external_deps = [
1165c735df2Sopenharmony_ci      "ability_base:want",
1175c735df2Sopenharmony_ci      "ability_runtime:ability_manager",
1185c735df2Sopenharmony_ci      "ffrt:libffrt",
1195c735df2Sopenharmony_ci      "hilog:libhilog",
1205c735df2Sopenharmony_ci      "ipc:ipc_single",
1215c735df2Sopenharmony_ci      "safwk:system_ability_fwk",
1225c735df2Sopenharmony_ci    ]
1235c735df2Sopenharmony_ci
1245c735df2Sopenharmony_ci    part_name = "location"
1255c735df2Sopenharmony_ci    subsystem_name = "location"
1265c735df2Sopenharmony_ci  }
1275c735df2Sopenharmony_ci} else {
1285c735df2Sopenharmony_ci  ohos_shared_library("lbsservice_geocode") {
1295c735df2Sopenharmony_ci    part_name = "location"
1305c735df2Sopenharmony_ci    subsystem_name = "location"
1315c735df2Sopenharmony_ci  }
1325c735df2Sopenharmony_ci
1335c735df2Sopenharmony_ci  ohos_static_library("lbsservice_geocode_static") {
1345c735df2Sopenharmony_ci    part_name = "location"
1355c735df2Sopenharmony_ci    subsystem_name = "location"
1365c735df2Sopenharmony_ci  }
1375c735df2Sopenharmony_ci}
138