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