1# Copyright (c) 2021 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 16SUBSYSTEM_DIR = "//base/sensors/sensor" 17 18############################################## 19ohos_ndk_library("libsensor_ndk") { 20 output_name = "sensor" 21 ndk_description_file = "./libsensor.json" 22 min_compact_version = "6" 23} 24 25config("sensor_private_config") { 26 include_dirs = [ 27 "//commonlibrary/c_utils/base/include", 28 "//utils/system/safwk/native/include", 29 "$SUBSYSTEM_DIR/frameworks/native/sensor/include", 30 "$SUBSYSTEM_DIR/utils/include", 31 "$SUBSYSTEM_DIR/interfaces/native/include", 32 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 33 "//base/notification/eventhandler/interfaces/inner_api", 34 ] 35} 36 37config("sensor_public_config") { 38 include_dirs = [ "include" ] 39} 40 41ohos_shared_library("sensor_interface_native") { 42 output_name = "sensor_agent" 43 sources = [ 44 "src/geomagnetic_field.cpp", 45 "src/sensor_agent.cpp", 46 "src/sensor_algorithm.cpp", 47 ] 48 49 configs = [ ":sensor_private_config" ] 50 public_configs = [ ":sensor_public_config" ] 51 52 deps = [ 53 "$SUBSYSTEM_DIR/frameworks/native/sensor:libsensor_native", 54 "$SUBSYSTEM_DIR/interfaces/native:libsensor_ndk", 55 ] 56 57 external_deps = [ 58 "c_utils:utils", 59 "hiviewdfx_hilog_native:libhilog", 60 ] 61 part_name = "sensor" 62 subsystem_name = "sensors" 63} 64 65############################################## 66group("sensor_ndk_target") { 67 deps = [ ":sensor_interface_native" ] 68} 69