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# 14 15import("//build/ohos.gni") 16 17if (defined(ohos_lite)) { 18 config("libhdi_sensor_pub_config") { 19 visibility = [ ":*" ] 20 } 21 22 ohos_shared_library("hdi_sensor") { 23 output_extension = "z.so" 24 public_configs = [ ":libhdi_sensor_pub_config" ] 25 sources = [ 26 "src/sensor_channel.c", 27 "src/sensor_controller.c", 28 "src/sensor_manager.c", 29 ] 30 31 include_dirs = [ 32 "include", 33 "../interfaces/include", 34 "../utils/include", 35 "//third_party/bounds_checking_function/include", 36 ] 37 38 deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 39 external_deps = [ 40 "hdf_core:libhdf_utils", 41 "hilog_lite:hilog_shared", 42 ] 43 cflags = [ 44 "-Wall", 45 "-Wextra", 46 "-Werror", 47 "-fsigned-char", 48 "-fno-common", 49 "-fno-strict-aliasing", 50 ] 51 if (ohos_build_compiler != "clang") { 52 cflags += [ 53 "-Wno-format", 54 "-Wno-format-extra-args", 55 ] 56 } 57 subsystem_name = "hdf" 58 part_name = "drivers_peripheral_sensor" 59 } 60} else { 61 config("libhdi_sensor_pub_config") { 62 visibility = [ ":*" ] 63 64 include_dirs = [ "../interfaces/include" ] 65 } 66 67 ohos_shared_library("hdi_sensor") { 68 public_configs = [ ":libhdi_sensor_pub_config" ] 69 sources = [ 70 "src/sensor_channel.c", 71 "src/sensor_controller.c", 72 "src/sensor_dump.c", 73 "src/sensor_manager.c", 74 ] 75 76 include_dirs = [ 77 "include", 78 " ../interfaces/include", 79 "../utils/include", 80 "//third_party/bounds_checking_function/include", 81 ] 82 defines = [ "__OHOS__USER__" ] 83 cflags = [ 84 "-Wall", 85 "-Wextra", 86 "-Werror", 87 "-fsigned-char", 88 "-fno-common", 89 "-fno-strict-aliasing", 90 ] 91 install_images = [ chipset_base_dir ] 92 subsystem_name = "hdf" 93 part_name = "drivers_peripheral_sensor" 94 if (is_standard_system) { 95 external_deps = [ 96 "c_utils:utils", 97 "hdf_core:libhdf_host", 98 "hdf_core:libhdf_utils", 99 "hilog:libhilog", 100 ] 101 } else { 102 external_deps = [ "hilog:libhilog" ] 103 } 104 } 105} 106