1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni") 15import("//build/ohos.gni") 16import("./../../../sensor.gni") 17 18ohos_shared_library("sensor_ani") { 19 branch_protector_ret = "pac_ret" 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 26 sources = [ "src/sensor_ani.cpp" ] 27 include_dirs = [ 28 "include", 29 "$SUBSYSTEM_DIR/frameworks/native/include", 30 "$SUBSYSTEM_DIR/interfaces/inner_api", 31 "$SUBSYSTEM_DIR/utils/common/include", 32 ] 33 deps = [ 34 "$SUBSYSTEM_DIR/frameworks/native:sensor_interface_native", 35 "$SUBSYSTEM_DIR/utils/common:libsensor_utils", 36 ] 37 38 external_deps = [ 39 "bundle_framework:appexecfwk_base", 40 "bundle_framework:appexecfwk_core", 41 "c_utils:utils", 42 "eventhandler:libeventhandler", 43 "hilog:libhilog", 44 "ipc:ipc_single", 45 "runtime_core:ani", 46 "safwk:system_ability_fwk", 47 "samgr:samgr_proxy", 48 ] 49 50 subsystem_name = "sensors" 51 part_name = "sensor" 52 output_extension = "so" 53} 54 55generate_static_abc("sensor_abc") { 56 base_url = "./ets" 57 files = [ "./ets/@ohos.sensor.ets" ] 58 dst_file = "$target_out_dir/sensor.abc" 59 out_puts = [ "$target_out_dir/sensor.abc" ] 60 is_boot_abc = "True" 61 device_dst_file = "/system/framework/sensor.abc" 62} 63 64ohos_prebuilt_etc("sensor_abc_etc") { 65 source = "$target_out_dir/sensor.abc" 66 module_install_dir = "framework" 67 subsystem_name = "sensors" 68 part_name = "sensor" 69 deps = [ ":sensor_abc" ] 70} 71 72group("sensor_ani_target") { 73 deps = [ 74 ":sensor_abc_etc", 75 ":sensor_ani", 76 ] 77} 78