1// Copyright (C) 2016 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 15cc_defaults { 16 name: "hwservicemanager_defaults", 17 cflags: [ 18 "-Wall", 19 "-Wextra", 20 "-Werror", 21 ], 22 shared_libs: [ 23 "libhidlbase", 24 "liblog", 25 ], 26} 27 28cc_defaults { 29 name: "libhwservicemanager_shared_libs", 30 shared_libs: [ 31 "libbase", 32 "libhidl-gen-utils", 33 "libselinux", 34 "libutils", 35 "libvintf", 36 ], 37} 38 39cc_library_static { 40 name: "libhwservicemanager", 41 host_supported: true, 42 defaults: [ 43 "hwservicemanager_defaults", 44 "libhwservicemanager_shared_libs", 45 ], 46 srcs: [ 47 "AccessControl.cpp", 48 "HidlService.cpp", 49 "ServiceManager.cpp", 50 "Vintf.cpp", 51 ], 52} 53 54cc_defaults { 55 name: "libtokenmanager_shared_libs", 56 shared_libs: [ 57 "android.hidl.token@1.0", 58 "libcrypto", 59 ], 60} 61 62cc_library_static { 63 name: "libtokenmanager", 64 defaults: [ 65 "hwservicemanager_defaults", 66 "libtokenmanager_shared_libs", 67 ], 68 srcs: [ 69 "TokenManager.cpp", 70 ], 71} 72 73cc_binary { 74 name: "hwservicemanager", 75 defaults: [ 76 "hwservicemanager_defaults", 77 "libhwservicemanager_shared_libs", 78 "libtokenmanager_shared_libs", 79 ], 80 init_rc: [ 81 "hwservicemanager.rc", 82 ], 83 srcs: [ 84 "service.cpp", 85 ], 86 shared_libs: [ 87 "libcutils", 88 ], 89 static_libs: [ 90 "libhwservicemanager", 91 "libtokenmanager", 92 ], 93} 94 95cc_test { 96 name: "hwservicemanager_test", 97 host_supported: true, 98 defaults: [ 99 "hwservicemanager_defaults", 100 "libhwservicemanager_shared_libs", 101 ], 102 static_libs: [ 103 "libgmock", 104 "libhwservicemanager", 105 ], 106 srcs: [ 107 "test_lazy.cpp", 108 ], 109 test_suites: ["device-tests"], 110} 111