1 // Copyright (C) 2009 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 subdirs = [ 16 "vts/performance", 17 ] 18 19 cc_defaults { 20 name: "libhwbinder_defaults", 21 shared_libs: [ 22 "libbase", 23 "liblog", 24 "libcutils", 25 "libutils", 26 ], 27 export_shared_lib_headers: [ 28 "libbase", 29 "libutils", 30 ], 31 export_include_dirs: ["include"], 32 include_dirs: ["frameworks/native/include"], 33 34 vendor_available: true, 35 vndk: { 36 enabled: true, 37 support_system_process: true, 38 }, 39 clang: true, 40 sanitize: { 41 misc_undefined: ["integer"], 42 }, 43 srcs: [ 44 "Binder.cpp", 45 "BpHwBinder.cpp", 46 "BufferedTextOutput.cpp", 47 "Debug.cpp", 48 "IInterface.cpp", 49 "IPCThreadState.cpp", 50 "Parcel.cpp", 51 "ProcessState.cpp", 52 "Static.cpp", 53 "TextOutput.cpp", 54 ], 55 56 product_variables: { 57 binder32bit: { 58 cflags: ["-DBINDER_IPC_32BIT=1"], 59 }, 60 }, 61 62 cflags: [ 63 "-Wall", 64 "-Werror", 65 ], 66 } 67 68 cc_library { 69 name: "libhwbinder", 70 defaults: [ 71 "libhwbinder_defaults", 72 "hwbinder_pgo", 73 "hwbinder_lto" 74 ], 75 } 76 77 // Explicitly provide a no lto, no PGO variant, to workaround the issue that we 78 // can't detect non-lto users of the module in Android.mk. 79 // http://b/77320844 80 cc_library { 81 name: "libhwbinder_noltopgo", 82 defaults: [ 83 "libhwbinder_defaults", 84 ], 85 } 86 87 // Provide pgo property to build hwbinder with PGO 88 cc_defaults { 89 name: "hwbinder_pgo", 90 pgo: { 91 instrumentation: true, 92 profile_file: "hwbinder/hwbinder.profdata", 93 benchmarks: ["hwbinder"], 94 enable_profile_use: true, 95 }, 96 } 97 // Provide lto property to build hwbinder with LTO 98 cc_defaults { 99 name: "hwbinder_lto", 100 target: { 101 android: { 102 lto: { 103 thin: true, 104 }, 105 }, 106 }, 107 } 108