aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof KosiƄski <krzysio@google.com>2020-09-11 12:07:03 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-11 12:07:03 +0000
commitb31c92665a1a5e10e8a23cacd4f8fd6a0ed09b75 (patch)
treefa1eed7a0305f9e914a768ded998cb1e9276bb0f
parent6ee8394bc0e240b3332f5609af6933c405cd7b6b (diff)
parent3f199de82c4144562f91612d475dc6637f00aa20 (diff)
downloadgoogle-benchmark-b31c92665a1a5e10e8a23cacd4f8fd6a0ed09b75.tar.gz
Merge "Add libgoogle-benchmark-main module." am: fedc32dd69 am: 33355bcdca am: 9222acf163 am: 3f199de82c
Original change: https://android-review.googlesource.com/c/platform/external/google-benchmark/+/1423810 Change-Id: I8626677109fb86b4c40f3dea79e996ef13748d4d
-rw-r--r--Android.bp24
1 files changed, 18 insertions, 6 deletions
diff --git a/Android.bp b/Android.bp
index e886e1c..88fe433 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,8 +14,8 @@
// limitations under the License.
//
-cc_library_static {
- name: "libgoogle-benchmark",
+cc_defaults {
+ name: "libgoogle-benchmark-defaults",
host_supported: true,
local_include_dirs: ["include"],
vendor_available: true,
@@ -25,16 +25,28 @@ cc_library_static {
"-Werror",
"-Wno-deprecated-declarations",
],
-
- exclude_srcs: [
- "src/benchmark_main.cc",
- ],
srcs: [
"src/*.cc",
],
export_include_dirs: ["include"],
}
+// For benchmarks that define their own main().
+cc_library_static {
+ name: "libgoogle-benchmark",
+ defaults: ["libgoogle-benchmark-defaults"],
+ exclude_srcs: [
+ "src/benchmark_main.cc",
+ ],
+}
+
+// For benchmarks that want to use the default main().
+// Make sure this dependency is in the whole_static_libs attribute.
+cc_library_static {
+ name: "libgoogle-benchmark-main",
+ defaults: ["libgoogle-benchmark-defaults"],
+}
+
cc_test {
name: "google-benchmark-test",
srcs: ["test/basic_test.cc"],