Yifan Hong | 7a6956e | 2021-11-08 23:52:44 -0800 | [diff] [blame^] | 1 | // Copyright (C) 2021 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package { |
| 16 | // See: http://go/android-license-faq |
| 17 | // A large-scale-change added 'default_applicable_licenses' to import |
| 18 | // all of the 'license_kinds' from "hardware_interfaces_license" |
| 19 | // to get the below license kinds: |
| 20 | // SPDX-license-identifier-Apache-2.0 |
| 21 | default_applicable_licenses: ["hardware_interfaces_license"], |
| 22 | } |
| 23 | |
| 24 | cc_defaults { |
| 25 | name: "libhealthshim_defaults", |
| 26 | host_supported: true, // for testing |
| 27 | defaults: [ |
| 28 | "libbinder_ndk_host_user", |
| 29 | ], |
| 30 | cflags: [ |
| 31 | "-Wall", |
| 32 | "-Werror", |
| 33 | ], |
| 34 | static_libs: [ |
| 35 | "android.hardware.health-V1-ndk", |
| 36 | "android.hardware.health-translate-ndk", |
| 37 | "android.hardware.health@1.0", |
| 38 | "android.hardware.health@2.0", |
| 39 | ], |
| 40 | shared_libs: [ |
| 41 | // These can be expected from the device or from host. |
| 42 | "libbase", |
| 43 | "libbinder_ndk", |
| 44 | "libcutils", |
| 45 | "libhidlbase", |
| 46 | "liblog", |
| 47 | "libutils", |
| 48 | ], |
| 49 | } |
| 50 | |
| 51 | // Shim library that wraps a HIDL IHealth object into an AIDL IHealth object. |
| 52 | cc_library_static { |
| 53 | name: "libhealthshim", |
| 54 | defaults: ["libhealthshim_defaults"], |
| 55 | recovery_available: true, |
| 56 | srcs: [ |
| 57 | "shim.cpp", |
| 58 | ], |
| 59 | export_include_dirs: [ |
| 60 | "include", |
| 61 | ], |
| 62 | } |
| 63 | |
| 64 | cc_test { |
| 65 | name: "libhealthshim_test", |
| 66 | defaults: ["libhealthshim_defaults"], |
| 67 | static_libs: [ |
| 68 | "libhealthshim", |
| 69 | "libgmock", |
| 70 | ], |
| 71 | srcs: [ |
| 72 | "test.cpp", |
| 73 | ], |
| 74 | test_suites: ["general-tests"], |
| 75 | test_options: { |
| 76 | unit_test: true, |
| 77 | }, |
| 78 | } |