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 "-Wno-gcc-compat", 26 "-Wunused", 27 ], 28 srcs: [ 29 "bionic_benchmarks.cpp", 30 "atomic_benchmark.cpp", 31 "inttypes_benchmark.cpp", 32 "math_benchmark.cpp", 33 "property_benchmark.cpp", 34 "pthread_benchmark.cpp", 35 "semaphore_benchmark.cpp", 36 "stdio_benchmark.cpp", 37 "stdlib_benchmark.cpp", 38 "string_benchmark.cpp", 39 "time_benchmark.cpp", 40 "unistd_benchmark.cpp", 41 ], 42 shared_libs: ["libtinyxml2"], 43 static_libs: [ 44 "libbase", 45 "libBionicBenchmarksUtils", 46 ], 47 } 48 49 cc_defaults { 50 name: "bionic-benchmarks-extras-defaults", 51 cflags: [ 52 "-Wall", 53 "-Wextra", 54 "-Werror", 55 "-Wunused", 56 ], 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"], 65 data: ["suites/*"], 66 static_libs: [ 67 "libsystemproperties", 68 "libasync_safe", 69 ], 70 include_dirs: ["bionic/libc"], 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"], 83 target: { 84 darwin: { 85 // Only supported on linux systems. 86 enabled: false, 87 }, 88 }, 89 data: ["suites/*"], 90 } 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", 104 "tests/interface_test.cpp", 105 ], 106 static_libs: [ 107 "libbase", 108 "libBionicBenchmarksUtils", 109 ], 110 data: [ 111 "suites/*", 112 "test_suites/*", 113 ], 114 } 115