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", |
Elliott Hughes | 7063a83 | 2017-12-19 08:55:40 -0800 | [diff] [blame] | 25 | "-Wno-gcc-compat", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 26 | "-Wunused", |
| 27 | ], |
| 28 | srcs: [ |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 29 | "bionic_benchmarks.cpp", |
Hans Boehm | 3f55787 | 2017-01-23 17:30:44 -0800 | [diff] [blame] | 30 | "atomic_benchmark.cpp", |
Elliott Hughes | 7063a83 | 2017-12-19 08:55:40 -0800 | [diff] [blame] | 31 | "inttypes_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 32 | "math_benchmark.cpp", |
| 33 | "property_benchmark.cpp", |
| 34 | "pthread_benchmark.cpp", |
| 35 | "semaphore_benchmark.cpp", |
| 36 | "stdio_benchmark.cpp", |
Christopher Ferris | 858e336 | 2017-11-30 08:53:15 -0800 | [diff] [blame] | 37 | "stdlib_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 38 | "string_benchmark.cpp", |
| 39 | "time_benchmark.cpp", |
| 40 | "unistd_benchmark.cpp", |
| 41 | ], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 42 | shared_libs: ["libtinyxml2"], |
| 43 | static_libs: [ |
| 44 | "libbase", |
| 45 | "libBionicBenchmarksUtils", |
| 46 | ], |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | cc_defaults { |
| 50 | name: "bionic-benchmarks-extras-defaults", |
| 51 | cflags: [ |
| 52 | "-Wall", |
| 53 | "-Wextra", |
| 54 | "-Werror", |
| 55 | "-Wunused", |
| 56 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | // Build benchmarks for the device (with bionic's .so). Run with: |
| 60 | // adb shell bionic-benchmarks32 |
| 61 | // adb shell bionic-benchmarks64 |
| 62 | cc_benchmark { |
| 63 | name: "bionic-benchmarks", |
| 64 | defaults: ["bionic-benchmarks-defaults"], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 65 | data: ["suites/*"], |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 66 | static_libs: [ |
| 67 | "libsystemproperties", |
| 68 | "libasync_safe", |
| 69 | ], |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 70 | include_dirs: ["bionic/libc"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | // We don't build a static benchmark executable because it's not usually |
| 74 | // useful. If you're trying to run the current benchmarks on an older |
| 75 | // release, it's (so far at least) always because you want to measure the |
| 76 | // performance of the old release's libc, and a static benchmark isn't |
| 77 | // going to let you do that. |
| 78 | |
| 79 | // Build benchmarks for the host (against glibc!). Run with: |
| 80 | cc_benchmark_host { |
| 81 | name: "bionic-benchmarks-glibc", |
| 82 | defaults: ["bionic-benchmarks-defaults"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 83 | target: { |
| 84 | darwin: { |
| 85 | // Only supported on linux systems. |
| 86 | enabled: false, |
| 87 | }, |
| 88 | }, |
Christopher Ferris | d9d39be | 2017-08-23 18:03:51 -0700 | [diff] [blame] | 89 | data: ["suites/*"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 90 | } |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 91 | |
| 92 | cc_library_static { |
| 93 | name: "libBionicBenchmarksUtils", |
| 94 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 95 | srcs: ["util.cpp"], |
| 96 | host_supported: true, |
| 97 | } |
| 98 | |
| 99 | cc_test { |
| 100 | name: "bionic-benchmarks-tests", |
| 101 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 102 | srcs: [ |
| 103 | "tests/benchmark_test.cpp", |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 104 | "tests/interface_test.cpp", |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 105 | ], |
Anders Lewis | 4b26f71 | 2017-08-11 15:56:18 -0700 | [diff] [blame] | 106 | static_libs: [ |
| 107 | "libbase", |
| 108 | "libBionicBenchmarksUtils", |
| 109 | ], |
Haibo Huang | 510dda3 | 2018-08-11 23:39:06 -0700 | [diff] [blame^] | 110 | data: ["test_suites/*"], |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 111 | } |