blob: 0edba659a4b5b2a5c3dd625885c6c4e4dc8713b8 [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: [
Hans Boehm3f557872017-01-23 17:30:44 -080028 "atomic_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070029 "math_benchmark.cpp",
30 "property_benchmark.cpp",
31 "pthread_benchmark.cpp",
32 "semaphore_benchmark.cpp",
33 "stdio_benchmark.cpp",
34 "string_benchmark.cpp",
35 "time_benchmark.cpp",
36 "unistd_benchmark.cpp",
37 ],
Anders Lewisf4447b92017-06-23 15:53:59 -070038 static_libs: ["libBionicBenchmarksUtils"],
39}
40
41cc_defaults {
42 name: "bionic-benchmarks-extras-defaults",
43 cflags: [
44 "-Wall",
45 "-Wextra",
46 "-Werror",
47 "-Wunused",
48 ],
Colin Cross2722ebb2016-07-11 16:20:06 -070049}
50
51// Build benchmarks for the device (with bionic's .so). Run with:
52// adb shell bionic-benchmarks32
53// adb shell bionic-benchmarks64
54cc_benchmark {
55 name: "bionic-benchmarks",
56 defaults: ["bionic-benchmarks-defaults"],
57}
58
59// We don't build a static benchmark executable because it's not usually
60// useful. If you're trying to run the current benchmarks on an older
61// release, it's (so far at least) always because you want to measure the
62// performance of the old release's libc, and a static benchmark isn't
63// going to let you do that.
64
65// Build benchmarks for the host (against glibc!). Run with:
66cc_benchmark_host {
67 name: "bionic-benchmarks-glibc",
68 defaults: ["bionic-benchmarks-defaults"],
69 host_ldlibs: ["-lrt"],
70 target: {
71 darwin: {
72 // Only supported on linux systems.
73 enabled: false,
74 },
75 },
76}
Anders Lewisf4447b92017-06-23 15:53:59 -070077
78cc_library_static {
79 name: "libBionicBenchmarksUtils",
80 defaults: ["bionic-benchmarks-extras-defaults"],
81 srcs: ["util.cpp"],
82 host_supported: true,
83}
84
85cc_test {
86 name: "bionic-benchmarks-tests",
87 defaults: ["bionic-benchmarks-extras-defaults"],
88 srcs: [
89 "tests/benchmark_test.cpp",
90 ],
91 static_libs: ["libBionicBenchmarksUtils"],
92}