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") 15import("./../../sensor.gni") 16 17ohos_shared_library("libsensor_utils") { 18 sources = [ 19 "src/active_info.cpp", 20 "src/permission_util.cpp", 21 "src/print_sensor_data.cpp", 22 "src/report_data_callback.cpp", 23 "src/sensor.cpp", 24 "src/sensor_basic_data_channel.cpp", 25 "src/sensor_basic_info.cpp", 26 "src/sensor_channel_info.cpp", 27 "src/sensor_xcollie.cpp", 28 ] 29 30 cflags = [ 31 "-ffunction-sections", 32 "-fdata-sections", 33 "-Oz", 34 ] 35 36 cflags_cc = [ 37 "-ffunction-sections", 38 "-fdata-sections", 39 "-Oz", 40 ] 41 42 branch_protector_ret = "pac_ret" 43 sanitize = { 44 cfi = true 45 cfi_cross_dso = true 46 debug = false 47 } 48 49 include_dirs = [ 50 "$SUBSYSTEM_DIR/interfaces/inner_api", 51 "$SUBSYSTEM_DIR/frameworks/native/include", 52 "$SUBSYSTEM_DIR/utils/common/include", 53 ] 54 55 external_deps = [ 56 "access_token:libaccesstoken_sdk", 57 "access_token:libprivacy_sdk", 58 "c_utils:utils", 59 "hicollie:libhicollie", 60 "hilog:libhilog", 61 "ipc:ipc_single", 62 ] 63 64 defines = sensor_default_defines 65 if (hiviewdfx_hisysevent_enable) { 66 external_deps += [ "hisysevent:libhisysevent" ] 67 } 68 69 innerapi_tags = [ "platformsdk_indirect" ] 70 part_name = "sensor" 71 subsystem_name = "sensors" 72} 73