# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("./../../../miscdevice.gni") ohos_ndk_library("libvibrator_ndk") { output_name = "vibrator_agent" ndk_description_file = "./libvibrator.json" min_compact_version = "6" } ohos_ndk_headers("vibrator_ndk_header") { dest_dir = "$ndk_headers_out_dir/sensors" sources = [ "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator/vibrator_agent.h", "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator/vibrator_agent_type.h", ] } config("vibrator_config") { include_dirs = [ "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator" ] } ohos_shared_library("vibrator_interface_native") { output_name = "vibrator_agent" sources = [ "vibrator_agent.cpp" ] include_dirs = [ "include", "$SUBSYSTEM_DIR/frameworks/native/common/include", "$SUBSYSTEM_DIR/interfaces/inner_api/light", "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator", "$SUBSYSTEM_DIR/utils/common/include", "$SUBSYSTEM_DIR/utils/haptic_decoder/interface", ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } defines = miscdevice_default_defines cflags = [ "-Wno-error=inconsistent-missing-override" ] deps = [ "$SUBSYSTEM_DIR/frameworks/native/light:light_ndk_header", "$SUBSYSTEM_DIR/frameworks/native/vibrator:libvibrator_native", "$SUBSYSTEM_DIR/frameworks/native/vibrator:libvibrator_ndk", ] external_deps = [ "cJSON:cjson", "c_utils:utils", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", ] public_configs = [ ":vibrator_config" ] innerapi_tags = [ "platformsdk" ] part_name = "miscdevice" subsystem_name = "sensors" } ohos_shared_library("libvibrator_native") { sources = [ "$SUBSYSTEM_DIR/frameworks/native/common/src/miscdevice_service_proxy.cpp", "src/vibrator_client_stub.cpp", "src/vibrator_service_client.cpp", ] include_dirs = [ "$SUBSYSTEM_DIR/utils/haptic_decoder/interface", "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator", "include", "$SUBSYSTEM_DIR/frameworks/native/common/include", "$SUBSYSTEM_DIR/interfaces/inner_api/light", "$SUBSYSTEM_DIR/utils/common/include", ] deps = [ "$SUBSYSTEM_DIR/utils/common:libmiscdevice_utils" ] branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } external_deps = [ "cJSON:cjson", "c_utils:utils", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_single", "samgr:samgr_proxy", ] defines = miscdevice_default_defines innerapi_tags = [ "platformsdk_indirect" ] part_name = "miscdevice" subsystem_name = "sensors" } group("vibrator_target") { deps = [ ":libvibrator_native", ":vibrator_interface_native", ] }