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 17cc_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 "get_heap_size_benchmark.cpp", 32 "inttypes_benchmark.cpp", 33 "malloc_benchmark.cpp", 34 "math_benchmark.cpp", 35 "property_benchmark.cpp", 36 "pthread_benchmark.cpp", 37 "semaphore_benchmark.cpp", 38 "stdio_benchmark.cpp", 39 "stdlib_benchmark.cpp", 40 "string_benchmark.cpp", 41 "time_benchmark.cpp", 42 "unistd_benchmark.cpp", 43 ], 44 shared_libs: ["liblog"], 45 static_libs: [ 46 "libbase", 47 "libBionicBenchmarksUtils", 48 "libtinyxml2", 49 ], 50 stl: "libc++_static", 51} 52 53cc_defaults { 54 name: "bionic-benchmarks-extras-defaults", 55 cflags: [ 56 "-Wall", 57 "-Wextra", 58 "-Werror", 59 "-Wunused", 60 ], 61} 62 63// Build benchmarks for the device (with bionic's .so). Run with: 64// adb shell bionic-benchmarks32 65// adb shell bionic-benchmarks64 66cc_benchmark { 67 name: "bionic-benchmarks", 68 defaults: ["bionic-benchmarks-defaults"], 69 data: ["suites/*"], 70 static_libs: [ 71 "libsystemproperties", 72 "libasync_safe", 73 ], 74 include_dirs: ["bionic/libc"], 75} 76 77// We don't build a static benchmark executable because it's not usually 78// useful. If you're trying to run the current benchmarks on an older 79// release, it's (so far at least) always because you want to measure the 80// performance of the old release's libc, and a static benchmark isn't 81// going to let you do that. 82 83// Build benchmarks for the host (against glibc!). Run with: 84cc_benchmark_host { 85 name: "bionic-benchmarks-glibc", 86 defaults: ["bionic-benchmarks-defaults"], 87 target: { 88 darwin: { 89 // Only supported on linux systems. 90 enabled: false, 91 }, 92 }, 93 data: ["suites/*"], 94} 95 96cc_library_static { 97 name: "libBionicBenchmarksUtils", 98 defaults: ["bionic-benchmarks-extras-defaults"], 99 srcs: ["util.cpp"], 100 host_supported: true, 101} 102 103cc_test { 104 name: "bionic-benchmarks-tests", 105 isolated: true, 106 defaults: ["bionic-benchmarks-extras-defaults"], 107 srcs: [ 108 "tests/benchmark_test.cpp", 109 "tests/interface_test.cpp", 110 ], 111 static_libs: [ 112 "libbase", 113 "libBionicBenchmarksUtils", 114 ], 115 data: ["test_suites/*"], 116} 117