blob: fd3d85a00397049f4d3f7313738e273b5d1003ee [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",
Elliott Hughes7063a832017-12-19 08:55:40 -080025 "-Wno-gcc-compat",
Colin Cross2722ebb2016-07-11 16:20:06 -070026 "-Wunused",
27 ],
28 srcs: [
Anders Lewisa7b0f882017-07-24 20:01:13 -070029 "bionic_benchmarks.cpp",
Hans Boehm3f557872017-01-23 17:30:44 -080030 "atomic_benchmark.cpp",
Elliott Hughes7063a832017-12-19 08:55:40 -080031 "inttypes_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070032 "math_benchmark.cpp",
33 "property_benchmark.cpp",
34 "pthread_benchmark.cpp",
35 "semaphore_benchmark.cpp",
36 "stdio_benchmark.cpp",
Christopher Ferris858e3362017-11-30 08:53:15 -080037 "stdlib_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070038 "string_benchmark.cpp",
39 "time_benchmark.cpp",
40 "unistd_benchmark.cpp",
41 ],
Anders Lewisa7b0f882017-07-24 20:01:13 -070042 shared_libs: ["libtinyxml2"],
43 static_libs: [
44 "libbase",
45 "libBionicBenchmarksUtils",
46 ],
Anders Lewisf4447b92017-06-23 15:53:59 -070047}
48
49cc_defaults {
50 name: "bionic-benchmarks-extras-defaults",
51 cflags: [
52 "-Wall",
53 "-Wextra",
54 "-Werror",
55 "-Wunused",
56 ],
Colin Cross2722ebb2016-07-11 16:20:06 -070057}
58
59// Build benchmarks for the device (with bionic's .so). Run with:
60// adb shell bionic-benchmarks32
61// adb shell bionic-benchmarks64
62cc_benchmark {
63 name: "bionic-benchmarks",
64 defaults: ["bionic-benchmarks-defaults"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070065 data: ["suites/*"],
Colin Cross2722ebb2016-07-11 16:20:06 -070066}
67
68// We don't build a static benchmark executable because it's not usually
69// useful. If you're trying to run the current benchmarks on an older
70// release, it's (so far at least) always because you want to measure the
71// performance of the old release's libc, and a static benchmark isn't
72// going to let you do that.
73
74// Build benchmarks for the host (against glibc!). Run with:
75cc_benchmark_host {
76 name: "bionic-benchmarks-glibc",
77 defaults: ["bionic-benchmarks-defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -070078 target: {
79 darwin: {
80 // Only supported on linux systems.
81 enabled: false,
82 },
83 },
Christopher Ferrisd9d39be2017-08-23 18:03:51 -070084 data: ["suites/*"],
Colin Cross2722ebb2016-07-11 16:20:06 -070085}
Anders Lewisf4447b92017-06-23 15:53:59 -070086
87cc_library_static {
88 name: "libBionicBenchmarksUtils",
89 defaults: ["bionic-benchmarks-extras-defaults"],
90 srcs: ["util.cpp"],
91 host_supported: true,
92}
93
94cc_test {
95 name: "bionic-benchmarks-tests",
96 defaults: ["bionic-benchmarks-extras-defaults"],
97 srcs: [
98 "tests/benchmark_test.cpp",
Anders Lewisa7b0f882017-07-24 20:01:13 -070099 "tests/interface_test.cpp",
Anders Lewisf4447b92017-06-23 15:53:59 -0700100 ],
Anders Lewis4b26f712017-08-11 15:56:18 -0700101 static_libs: [
102 "libbase",
103 "libBionicBenchmarksUtils",
104 ],
Christopher Ferrisd9d39be2017-08-23 18:03:51 -0700105 data: ["suites/*", "test_suites/*"],
Anders Lewisf4447b92017-06-23 15:53:59 -0700106}