1# Copyright (c) 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") 15 16declare_args() { 17 miscdevice_feature_vibrator_custom = true 18 miscdevice_feature_hiviewdfx_hisysevent = true 19 miscdevice_feature_vibrator_input_method_enable = true 20 miscdevice_feature_crown_vibrator_enable = false 21 miscdevice_feature_do_not_disturb_enable = false 22} 23 24print( 25 "miscdevice_feature_vibrator_custom = ${miscdevice_feature_vibrator_custom}") 26 27SUBSYSTEM_DIR = "//base/sensors/miscdevice" 28 29FUZZ_MODULE_OUT_PATH = "miscdevice/miscdevice" 30 31miscdevice_default_defines = [] 32 33if (miscdevice_feature_vibrator_custom) { 34 miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM" ] 35} 36 37if (miscdevice_feature_vibrator_input_method_enable) { 38 miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_VIBRATOR_INPUT_METHOD" ] 39} else { 40 miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_VIBRATOR_PRESET_INFO" ] 41} 42 43if (miscdevice_feature_crown_vibrator_enable) { 44 miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_VIBRATOR_CROWN" ] 45} 46 47if (miscdevice_feature_do_not_disturb_enable) { 48 miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_DO_NOT_DISTURB" ] 49} 50 51if (!defined(global_parts_info) || 52 defined(global_parts_info.hdf_drivers_interface_light)) { 53 hdf_drivers_interface_light = true 54 miscdevice_default_defines += [ "HDF_DRIVERS_INTERFACE_LIGHT" ] 55} else { 56 hdf_drivers_interface_light = false 57} 58 59if (!defined(global_parts_info) || 60 defined(global_parts_info.resourceschedule_memmgr_override)) { 61 miscdevice_memmgr_enable = true 62} else { 63 miscdevice_memmgr_enable = false 64} 65 66if (build_variant == "root") { 67 miscdevice_default_defines += [ "BUILD_VARIANT_ENG" ] 68 miscdevice_build_eng = true 69} else { 70 miscdevice_build_eng = false 71} 72 73if (!defined(global_parts_info) || 74 defined(global_parts_info.hdf_drivers_interface_vibrator)) { 75 miscdevice_feature_hdf_drivers_interface_vibrator = true 76 miscdevice_default_defines += [ "HDF_DRIVERS_INTERFACE_VIBRATOR" ] 77} else { 78 miscdevice_feature_hdf_drivers_interface_vibrator = false 79} 80 81if (!defined(global_parts_info) || 82 defined(global_parts_info.hiviewdfx_hisysevent)) { 83 miscdevice_feature_hiviewdfx_hisysevent = true 84 miscdevice_default_defines += [ "HIVIEWDFX_HISYSEVENT_ENABLE" ] 85} else { 86 miscdevice_feature_hiviewdfx_hisysevent = false 87} 88 89if (!defined(global_parts_info) || 90 defined(global_parts_info.hiviewdfx_hitrace)) { 91 miscdevice_feature_hiviewdfx_hitrace = true 92 miscdevice_default_defines += [ "HIVIEWDFX_HITRACE_ENABLE" ] 93} else { 94 miscdevice_feature_hiviewdfx_hitrace = false 95} 96