aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kosiński <krzysio@google.com>2020-09-09 19:30:56 -0700
committerKrzysztof Kosiński <krzysio@google.com>2020-09-09 19:30:56 -0700
commit1c531254a8342c7a9dd9db2715627e7449bc4cf2 (patch)
tree9f0dbb1e9405fe12c7b413e7e54f53ffe2d59a04
parentf0d2e25a738b0deaf1df7c8d05f55175488c76e9 (diff)
downloadgoogle-benchmark-1c531254a8342c7a9dd9db2715627e7449bc4cf2.tar.gz
Add libgoogle-benchmark-main module.
This is useful for benchmarks that don't need a custom main(). Test: mm in external/google-benchmark Change-Id: I5de2e60ac080a288f06ee561ad3104429d679fc1
-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"],