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