1// 2// Copyright (C) 2018 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: "memory_flag_defaults", 19 host_supported: false, 20 21 cflags: [ 22 "-Wall", 23 "-Wextra", 24 "-Werror", 25 ], 26 27 compile_multilib: "both", 28} 29 30cc_defaults { 31 name: "memory_replay_defaults", 32 defaults: ["memory_flag_defaults"], 33 34 srcs: [ 35 "Alloc.cpp", 36 "File.cpp", 37 "NativeInfo.cpp", 38 "Pointers.cpp", 39 "Thread.cpp", 40 "Threads.cpp", 41 ], 42 43 shared_libs: [ 44 "libbase", 45 "libziparchive", 46 ], 47 48 static_libs: [ 49 "libasync_safe", 50 ], 51} 52 53cc_binary { 54 name: "memory_replay", 55 defaults: ["memory_replay_defaults"], 56 57 srcs: ["main.cpp"], 58 59 multilib: { 60 lib32: { 61 suffix: "32", 62 }, 63 lib64: { 64 suffix: "64", 65 }, 66 }, 67} 68 69cc_test { 70 name: "memory_replay_tests", 71 defaults: ["memory_replay_defaults"], 72 isolated: true, 73 74 srcs: [ 75 "tests/AllocTest.cpp", 76 "tests/FileTest.cpp", 77 "tests/NativeInfoTest.cpp", 78 "tests/PointersTest.cpp", 79 "tests/ThreadTest.cpp", 80 "tests/ThreadsTest.cpp", 81 ], 82 83 local_include_dirs: ["tests"], 84 85 target: { 86 android: { 87 test_suites: ["device-tests"], 88 }, 89 }, 90 91 data: [ 92 "tests/test.txt", 93 "tests/test.zip", 94 ], 95} 96 97cc_benchmark { 98 name: "trace_benchmark", 99 defaults: ["memory_flag_defaults"], 100 101 srcs: [ 102 "Alloc.cpp", 103 "TraceBenchmark.cpp", 104 "File.cpp", 105 ], 106 107 shared_libs: [ 108 "libbase", 109 "libziparchive", 110 ], 111 112 data: [ 113 "traces/*.zip", 114 ], 115} 116