1# Copyright (c) 2021-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. 13 14import("//build/ohos.gni") 15import("../sensor.gni") 16 17config("sensor_vdi_config") { 18 include_dirs = [ 19 "../interfaces/include", 20 "../interfaces/v1_0", 21 ] 22} 23 24ohos_static_library("libsensor_vdi_config") { 25 public_configs = [ ":sensor_vdi_config" ] 26} 27 28ohos_shared_library("libsensor_interface_service_2.1") { 29 defines = [] 30 if (build_variant == "root") { 31 defines += [ "SENSOR_DEBUG" ] 32 } 33 include_dirs = [ 34 ".", 35 "../interfaces/include", 36 "../interfaces/v1_0", 37 "../utils/include", 38 ] 39 40 sources = [ 41 "sensor_callback_vdi.cpp", 42 "sensor_client_info.cpp", 43 "sensor_clients_manager.cpp", 44 "sensor_hdi_dump.cpp", 45 "sensor_if_service.cpp", 46 ] 47 48 cflags = [ 49 "-Wall", 50 "-Wextra", 51 "-Werror", 52 "-fsigned-char", 53 "-fno-common", 54 "-fno-strict-aliasing", 55 ] 56 57 if (is_standard_system) { 58 external_deps = [ 59 "drivers_interface_sensor:libsensor_stub_2.0", 60 "drivers_interface_sensor:libsensor_stub_2.1", 61 "hdf_core:libhdf_host", 62 "hdf_core:libhdf_ipc_adapter", 63 "hdf_core:libhdf_utils", 64 "hilog:libhilog", 65 "hitrace:hitrace_meter", 66 "ipc:ipc_single", 67 ] 68 if (c_utils_enable) { 69 external_deps += [ "c_utils:utils" ] 70 } 71 } else { 72 external_deps = [ 73 "hilog:libhilog", 74 "ipc:ipc_single", 75 ] 76 } 77 78 install_images = [ chipset_base_dir ] 79 subsystem_name = "hdf" 80 part_name = "drivers_peripheral_sensor" 81} 82 83ohos_shared_library("libsensor_driver_2.1") { 84 include_dirs = [ 85 "../interfaces/include/", 86 "../utils/include", 87 ] 88 sources = [ "sensor_if_driver.cpp" ] 89 90 cflags = [ 91 "-Wall", 92 "-Wextra", 93 "-Werror", 94 "-fsigned-char", 95 "-fno-common", 96 "-fno-strict-aliasing", 97 ] 98 99 if (is_standard_system) { 100 external_deps = [ 101 "drivers_interface_sensor:libsensor_stub_2.0", 102 "drivers_interface_sensor:libsensor_stub_2.1", 103 "hdf_core:libhdf_host", 104 "hdf_core:libhdf_ipc_adapter", 105 "hdf_core:libhdf_utils", 106 "hdf_core:libhdi", 107 "hilog:libhilog", 108 "ipc:ipc_single", 109 ] 110 if (c_utils_enable) { 111 external_deps += [ "c_utils:utils" ] 112 } 113 } else { 114 external_deps = [ 115 "hilog:libhilog", 116 "ipc:ipc_single", 117 ] 118 } 119 120 shlib_type = "hdi" 121 install_images = [ chipset_base_dir ] 122 subsystem_name = "hdf" 123 part_name = "drivers_peripheral_sensor" 124} 125 126group("hdi_sensor_service") { 127 deps = [ 128 ":libsensor_driver_2.1", 129 ":libsensor_interface_service_2.1", 130 ] 131} 132