Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 17 | // TODO(b/31559095): bionic on host should define this |
| 18 | cc_defaults { |
| 19 | name: "libbinder_ndk_host_user", |
| 20 | target: { |
| 21 | host: { |
| 22 | cflags: [ |
| 23 | "-D__INTRODUCED_IN(n)=", |
| 24 | "-D__assert(a,b,c)=", |
Elliott Hughes | 906e0bb | 2019-10-30 14:14:45 -0700 | [diff] [blame] | 25 | // We want all the APIs to be available on the host. |
| 26 | "-D__ANDROID_API__=10000", |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 27 | ], |
| 28 | }, |
Yifan Hong | f856a98 | 2020-10-30 14:51:17 -0700 | [diff] [blame] | 29 | darwin: { |
| 30 | enabled: false, |
| 31 | }, |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 32 | }, |
| 33 | } |
| 34 | |
Steven Moreland | 28f8142 | 2019-10-03 10:40:59 -0700 | [diff] [blame] | 35 | cc_library { |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 36 | name: "libbinder_ndk", |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 37 | |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 38 | defaults: ["libbinder_ndk_host_user"], |
| 39 | host_supported: true, |
| 40 | |
Colin Cross | 8af6d1c | 2020-10-19 13:38:00 -0700 | [diff] [blame] | 41 | llndk_stubs: "libbinder_ndk.llndk", |
| 42 | |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 43 | export_include_dirs: [ |
Steven Moreland | 34aac10 | 2020-07-07 23:24:45 +0000 | [diff] [blame] | 44 | "include_cpp", |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 45 | "include_ndk", |
Steven Moreland | 6b7ea2a | 2019-08-08 16:19:21 -0700 | [diff] [blame] | 46 | "include_platform", |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 47 | ], |
| 48 | |
Steven Moreland | b8cfad5 | 2019-01-09 13:07:00 -0800 | [diff] [blame] | 49 | cflags: [ |
| 50 | "-Wall", |
| 51 | "-Wextra", |
| 52 | "-Werror", |
| 53 | ], |
Steven Moreland | 763dc4c | 2018-12-12 11:30:06 -0800 | [diff] [blame] | 54 | |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 55 | srcs: [ |
Steven Moreland | 4d5ad49 | 2018-09-13 12:49:16 -0700 | [diff] [blame] | 56 | "ibinder.cpp", |
Steven Moreland | 02f7565 | 2018-09-18 14:08:30 -0700 | [diff] [blame] | 57 | "ibinder_jni.cpp", |
Steven Moreland | 4d5ad49 | 2018-09-13 12:49:16 -0700 | [diff] [blame] | 58 | "parcel.cpp", |
Steven Moreland | 7c61558 | 2020-01-06 16:34:39 -0800 | [diff] [blame] | 59 | "parcel_jni.cpp", |
Steven Moreland | 4d5ad49 | 2018-09-13 12:49:16 -0700 | [diff] [blame] | 60 | "process.cpp", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 61 | "stability.cpp", |
Steven Moreland | 5d62e44 | 2018-09-13 15:01:02 -0700 | [diff] [blame] | 62 | "status.cpp", |
Steven Moreland | 4d5ad49 | 2018-09-13 12:49:16 -0700 | [diff] [blame] | 63 | "service_manager.cpp", |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 64 | ], |
| 65 | |
| 66 | shared_libs: [ |
Jooyung Han | 1f65e77 | 2019-03-07 16:55:04 +0900 | [diff] [blame] | 67 | "libandroid_runtime_lazy", |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 68 | "libbase", |
| 69 | "libbinder", |
| 70 | "libutils", |
| 71 | ], |
dimitry | b2cf95d | 2018-10-31 14:56:29 +0100 | [diff] [blame] | 72 | |
Steven Moreland | f01f744 | 2019-02-11 15:04:13 -0800 | [diff] [blame] | 73 | header_libs: [ |
| 74 | "jni_headers", |
| 75 | ], |
| 76 | export_header_lib_headers: [ |
| 77 | "jni_headers", |
| 78 | ], |
| 79 | |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 80 | target: { |
Steven Moreland | 28f8142 | 2019-10-03 10:40:59 -0700 | [diff] [blame] | 81 | android: { |
| 82 | // Only one copy of this library on an Android device |
| 83 | static: { |
| 84 | enabled: false, |
| 85 | }, |
| 86 | }, |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 87 | linux: { |
| 88 | version_script: "libbinder_ndk.map.txt", |
| 89 | }, |
Yifan Hong | f856a98 | 2020-10-30 14:51:17 -0700 | [diff] [blame] | 90 | darwin: { |
| 91 | enabled: false, |
| 92 | }, |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 93 | }, |
Dongwon Kang | c45ac09 | 2018-12-11 21:59:02 +0000 | [diff] [blame] | 94 | stubs: { |
| 95 | symbol_file: "libbinder_ndk.map.txt", |
Steven Moreland | e8a434d | 2019-09-20 18:42:35 +0000 | [diff] [blame] | 96 | versions: [ |
| 97 | "29", |
| 98 | "30", |
| 99 | ], |
Dongwon Kang | c45ac09 | 2018-12-11 21:59:02 +0000 | [diff] [blame] | 100 | }, |
Jiyong Park | 4f97a8c | 2020-11-16 18:11:14 +0900 | [diff] [blame] | 101 | tidy: true, |
| 102 | tidy_flags: [ |
| 103 | // Only check our headers |
| 104 | "--header-filter=^.*frameworks/native/libs/binder/.*.h$", |
| 105 | ], |
| 106 | tidy_checks_as_errors: [ |
Chih-Hung Hsieh | 09d11b3 | 2021-01-11 21:29:01 -0800 | [diff] [blame] | 107 | // Explicitly list the checks that should not occur in this module. |
| 108 | "abseil-*", |
| 109 | "android-*", |
| 110 | "bugprone-*", |
| 111 | "cert-*", |
| 112 | "clang-analyzer-*", |
Jiyong Park | 7ad197b | 2020-12-16 10:14:10 +0900 | [diff] [blame] | 113 | "-clang-analyzer-core.CallAndMessage", |
| 114 | "-clang-analyzer-core.uninitialized.Assign", |
Jiyong Park | 21a7de5 | 2021-01-12 17:54:27 +0900 | [diff] [blame] | 115 | "-clang-analyzer-unix.Malloc", |
Jiyong Park | 7ad197b | 2020-12-16 10:14:10 +0900 | [diff] [blame] | 116 | "-clang-analyzer-deadcode.DeadStores", |
| 117 | "-clang-analyzer-optin.cplusplus.UninitializedObject", |
Chih-Hung Hsieh | 09d11b3 | 2021-01-11 21:29:01 -0800 | [diff] [blame] | 118 | "google-*", |
| 119 | "-google-readability-*", |
| 120 | "-google-runtime-references", |
| 121 | "misc-*", |
Jiyong Park | 7ad197b | 2020-12-16 10:14:10 +0900 | [diff] [blame] | 122 | "-misc-no-recursion", |
Chih-Hung Hsieh | 09d11b3 | 2021-01-11 21:29:01 -0800 | [diff] [blame] | 123 | "-misc-non-private-member-variables-in-classes", |
Jiyong Park | 7ad197b | 2020-12-16 10:14:10 +0900 | [diff] [blame] | 124 | "-misc-redundant-expression", |
Chih-Hung Hsieh | 09d11b3 | 2021-01-11 21:29:01 -0800 | [diff] [blame] | 125 | "-misc-unused-parameters", |
Jiyong Park | 7ad197b | 2020-12-16 10:14:10 +0900 | [diff] [blame] | 126 | "-misc-unused-using-decls", |
Chih-Hung Hsieh | 09d11b3 | 2021-01-11 21:29:01 -0800 | [diff] [blame] | 127 | "performance*", |
| 128 | "portability*", |
Jiyong Park | 4f97a8c | 2020-11-16 18:11:14 +0900 | [diff] [blame] | 129 | ], |
Steven Moreland | 2e87adc | 2018-08-20 19:47:00 -0700 | [diff] [blame] | 130 | } |
Steven Moreland | eb0e9cc | 2018-08-29 01:52:09 -0700 | [diff] [blame] | 131 | |
Jooyung Han | caede59 | 2021-02-04 10:18:37 +0900 | [diff] [blame^] | 132 | cc_library_headers { |
| 133 | name: "libbinder_headers_platform_shared", |
| 134 | export_include_dirs: ["include_cpp"], |
| 135 | vendor_available: true, |
| 136 | host_supported: true, |
| 137 | // TODO(b/153609531): remove when no longer needed. |
| 138 | native_bridge_supported: true, |
| 139 | target: { |
| 140 | darwin: { |
| 141 | enabled: false, |
| 142 | }, |
| 143 | }, |
| 144 | min_sdk_version: "29", |
| 145 | apex_available: [ |
| 146 | "//apex_available:platform", |
| 147 | // TODO(b/166468760) remove these three |
| 148 | "com.android.media", |
| 149 | "com.android.media.swcodec", |
| 150 | "test_com.android.media.swcodec", |
| 151 | ], |
| 152 | } |
| 153 | |
Steven Moreland | eb0e9cc | 2018-08-29 01:52:09 -0700 | [diff] [blame] | 154 | ndk_headers { |
| 155 | name: "libbinder_ndk_headers", |
| 156 | from: "include_ndk/android", |
| 157 | to: "android", |
| 158 | srcs: [ |
| 159 | "include_ndk/android/*.h", |
| 160 | ], |
| 161 | license: "NOTICE", |
| 162 | } |
| 163 | |
Steven Moreland | 34aac10 | 2020-07-07 23:24:45 +0000 | [diff] [blame] | 164 | // TODO(b/160624671): package with the aidl compiler |
| 165 | ndk_headers { |
| 166 | name: "libbinder_ndk_helper_headers", |
| 167 | from: "include_cpp/android", |
| 168 | to: "android", |
| 169 | srcs: [ |
| 170 | "include_cpp/android/*.h", |
| 171 | ], |
| 172 | license: "NOTICE", |
| 173 | } |
| 174 | |
Steven Moreland | eb0e9cc | 2018-08-29 01:52:09 -0700 | [diff] [blame] | 175 | ndk_library { |
| 176 | name: "libbinder_ndk", |
| 177 | symbol_file: "libbinder_ndk.map.txt", |
| 178 | first_version: "29", |
| 179 | } |
Steven Moreland | f1ac0ac | 2019-07-22 17:46:38 -0700 | [diff] [blame] | 180 | |
| 181 | llndk_library { |
Colin Cross | 8af6d1c | 2020-10-19 13:38:00 -0700 | [diff] [blame] | 182 | name: "libbinder_ndk.llndk", |
Steven Moreland | f1ac0ac | 2019-07-22 17:46:38 -0700 | [diff] [blame] | 183 | symbol_file: "libbinder_ndk.map.txt", |
| 184 | export_include_dirs: [ |
Steven Moreland | 34aac10 | 2020-07-07 23:24:45 +0000 | [diff] [blame] | 185 | "include_cpp", |
Steven Moreland | f1ac0ac | 2019-07-22 17:46:38 -0700 | [diff] [blame] | 186 | "include_ndk", |
Steven Moreland | 6b7ea2a | 2019-08-08 16:19:21 -0700 | [diff] [blame] | 187 | "include_platform", |
Steven Moreland | f1ac0ac | 2019-07-22 17:46:38 -0700 | [diff] [blame] | 188 | ], |
| 189 | } |