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 17ohos_shared_library("libsensor_interface_service_2.0") { 18 defines = [] 19 if (build_variant == "root") { 20 defines += [ "SENSOR_DEBUG" ] 21 } 22 include_dirs = [ 23 ".", 24 "../interfaces/include", 25 "../interfaces/v1_0", 26 "../utils/include", 27 ] 28 29 sources = [ 30 "sensor_callback_vdi.cpp", 31 "sensor_client_info.cpp", 32 "sensor_clients_manager.cpp", 33 "sensor_hdi_dump.cpp", 34 "sensor_if_service.cpp", 35 ] 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 "drivers_interface_sensor:libsensor_stub_2.0", 49 "hdf_core:libhdf_host", 50 "hdf_core:libhdf_ipc_adapter", 51 "hdf_core:libhdf_utils", 52 "hilog:libhilog", 53 "hitrace:hitrace_meter", 54 "ipc:ipc_single", 55 ] 56 if (c_utils_enable) { 57 external_deps += [ "c_utils:utils" ] 58 } 59 } else { 60 external_deps = [ 61 "hilog:libhilog", 62 "ipc:ipc_single", 63 ] 64 } 65 66 install_images = [ chipset_base_dir ] 67 subsystem_name = "hdf" 68 part_name = "drivers_peripheral_sensor" 69} 70 71ohos_shared_library("libsensor_driver") { 72 include_dirs = [ 73 "../interfaces/include/", 74 "../utils/include", 75 ] 76 sources = [ "sensor_if_driver.cpp" ] 77 78 cflags = [ 79 "-Wall", 80 "-Wextra", 81 "-Werror", 82 "-fsigned-char", 83 "-fno-common", 84 "-fno-strict-aliasing", 85 ] 86 87 if (is_standard_system) { 88 external_deps = [ 89 "drivers_interface_sensor:libsensor_stub_2.0", 90 "hdf_core:libhdf_host", 91 "hdf_core:libhdf_ipc_adapter", 92 "hdf_core:libhdf_utils", 93 "hdf_core:libhdi", 94 "hilog:libhilog", 95 "ipc:ipc_single", 96 ] 97 if (c_utils_enable) { 98 external_deps += [ "c_utils:utils" ] 99 } 100 } else { 101 external_deps = [ 102 "hilog:libhilog", 103 "ipc:ipc_single", 104 ] 105 } 106 107 shlib_type = "hdi" 108 install_images = [ chipset_base_dir ] 109 subsystem_name = "hdf" 110 part_name = "drivers_peripheral_sensor" 111} 112 113group("hdi_sensor_service") { 114 deps = [ 115 ":libsensor_driver", 116 ":libsensor_interface_service_2.0", 117 ] 118} 119