blob: fae6f20af0f67bedca3288427461508518b1e528 [file] [log] [blame]
Colin Cross2722ebb2016-07-11 16:20:06 -07001//
2// Copyright (C) 2013 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
17cc_defaults {
18 name: "bionic-benchmarks-defaults",
19 cflags: [
20 "-O2",
21 "-fno-builtin",
22 "-Wall",
23 "-Wextra",
24 "-Werror",
25 "-Wunused",
26 ],
27 srcs: [
Anders Lewisa7b0f882017-07-24 20:01:13 -070028 "bionic_benchmarks.cpp",
Hans Boehm3f557872017-01-23 17:30:44 -080029 "atomic_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070030 "math_benchmark.cpp",
31 "property_benchmark.cpp",
32 "pthread_benchmark.cpp",
33 "semaphore_benchmark.cpp",
34 "stdio_benchmark.cpp",
35 "string_benchmark.cpp",
36 "time_benchmark.cpp",
37 "unistd_benchmark.cpp",
38 ],
Anders Lewisa7b0f882017-07-24 20:01:13 -070039 shared_libs: ["libtinyxml2"],
40 static_libs: [
41 "libbase",
42 "libBionicBenchmarksUtils",
43 ],
Anders Lewisf4447b92017-06-23 15:53:59 -070044}
45
46cc_defaults {
47 name: "bionic-benchmarks-extras-defaults",
48 cflags: [
49 "-Wall",
50 "-Wextra",
51 "-Werror",
52 "-Wunused",
53 ],
Colin Cross2722ebb2016-07-11 16:20:06 -070054}
55
56// Build benchmarks for the device (with bionic's .so). Run with:
57// adb shell bionic-benchmarks32
58// adb shell bionic-benchmarks64
59cc_benchmark {
60 name: "bionic-benchmarks",
61 defaults: ["bionic-benchmarks-defaults"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070062 data: ["suites/*"],
Colin Cross2722ebb2016-07-11 16:20:06 -070063}
64
65// We don't build a static benchmark executable because it's not usually
66// useful. If you're trying to run the current benchmarks on an older
67// release, it's (so far at least) always because you want to measure the
68// performance of the old release's libc, and a static benchmark isn't
69// going to let you do that.
70
71// Build benchmarks for the host (against glibc!). Run with:
72cc_benchmark_host {
73 name: "bionic-benchmarks-glibc",
74 defaults: ["bionic-benchmarks-defaults"],
75 host_ldlibs: ["-lrt"],
76 target: {
77 darwin: {
78 // Only supported on linux systems.
79 enabled: false,
80 },
81 },
82}
Anders Lewisf4447b92017-06-23 15:53:59 -070083
84cc_library_static {
85 name: "libBionicBenchmarksUtils",
86 defaults: ["bionic-benchmarks-extras-defaults"],
87 srcs: ["util.cpp"],
88 host_supported: true,
89}
90
91cc_test {
92 name: "bionic-benchmarks-tests",
93 defaults: ["bionic-benchmarks-extras-defaults"],
94 srcs: [
95 "tests/benchmark_test.cpp",
Anders Lewisa7b0f882017-07-24 20:01:13 -070096 "tests/interface_test.cpp",
Anders Lewisf4447b92017-06-23 15:53:59 -070097 ],
98 static_libs: ["libBionicBenchmarksUtils"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070099 data: ["suites/test_*.xml"],
Anders Lewisf4447b92017-06-23 15:53:59 -0700100}