Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | cc_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 Boehm | 3f55787 | 2017-01-23 17:30:44 -0800 | [diff] [blame] | 28 | "atomic_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 29 | "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 Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame^] | 38 | static_libs: ["libBionicBenchmarksUtils"], |
| 39 | } |
| 40 | |
| 41 | cc_defaults { |
| 42 | name: "bionic-benchmarks-extras-defaults", |
| 43 | cflags: [ |
| 44 | "-Wall", |
| 45 | "-Wextra", |
| 46 | "-Werror", |
| 47 | "-Wunused", |
| 48 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | // Build benchmarks for the device (with bionic's .so). Run with: |
| 52 | // adb shell bionic-benchmarks32 |
| 53 | // adb shell bionic-benchmarks64 |
| 54 | cc_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: |
| 66 | cc_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 Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame^] | 77 | |
| 78 | cc_library_static { |
| 79 | name: "libBionicBenchmarksUtils", |
| 80 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 81 | srcs: ["util.cpp"], |
| 82 | host_supported: true, |
| 83 | } |
| 84 | |
| 85 | cc_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 | } |