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