1# Copyright (c) 2022-2023 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. 13import("//build/ohos.gni") 14import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 15import("../../location.gni") 16 17config("libagnss_interface_service_cfg") { 18 visibility = [":*"] 19 include_dirs = [ "${location_driver_path}/gnss/hdi_service" ] 20} 21 22ohos_shared_library("libgnss_interface_service_2.0") { 23 public_configs = [":libagnss_interface_service_cfg"] 24 sources = [ 25 "gnss_interface_impl.cpp", 26 "location_vendor_interface.cpp", 27 "string_utils.cpp", 28 ] 29 30 sanitize = { 31 cfi = true 32 cfi_cross_dso = true 33 debug = false 34 } 35 branch_protector_ret = "pac_ret" 36 37 cflags = [ 38 "-Wall", 39 "-Wextra", 40 "-Werror", 41 "-fsigned-char", 42 "-fno-common", 43 "-fno-strict-aliasing", 44 ] 45 46 if (is_standard_system) { 47 external_deps = [ 48 "c_utils:utils", 49 "drivers_interface_location_gnss:location_gnss_idl_headers", 50 "hdf_core:libhdi", 51 "hilog:libhilog", 52 "ipc:ipc_single", 53 ] 54 } else { 55 external_deps = [ 56 "hilog:libhilog", 57 "ipc:ipc_single", 58 ] 59 } 60 61 defines = [] 62 if (is_emulator) { 63 defines += [ "EMULATOR_ENABLED" ] 64 } 65 66 install_images = [ chipset_base_dir ] 67 subsystem_name = "hdf" 68 part_name = "drivers_peripheral_location_gnss" 69} 70 71ohos_shared_library("liblocation_gnss_hdi_driver") { 72 include_dirs = [ "${location_driver_path}/gnss/hdi_service" ] 73 74 sources = [ "gnss_interface_driver.cpp" ] 75 76 cflags = [ 77 "-Wall", 78 "-Wextra", 79 "-Werror", 80 "-fsigned-char", 81 "-fno-common", 82 "-fno-strict-aliasing", 83 ] 84 85 if (is_standard_system) { 86 external_deps = [ 87 "c_utils:utils", 88 "hdf_core:libhdf_host", 89 "hdf_core:libhdf_ipc_adapter", 90 "hdf_core:libhdf_utils", 91 "hdf_core:libhdi", 92 "hilog:libhilog", 93 "ipc:ipc_single", 94 ] 95 } else { 96 external_deps = [ 97 "hilog:libhilog", 98 "ipc:ipc_single", 99 ] 100 } 101 102 external_deps += 103 [ "drivers_interface_location_gnss:liblocation_gnss_stub_2.0" ] 104 105 shlib_type = "hdi" 106 install_images = [ chipset_base_dir ] 107 subsystem_name = "hdf" 108 part_name = "drivers_peripheral_location_gnss" 109} 110 111group("hdi_location_gnss_service") { 112 deps = [ 113 ":libgnss_interface_service_2.0", 114 ":liblocation_gnss_hdi_driver", 115 ] 116} 117