Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "libmemunreachable_defaults", |
| 3 | |
| 4 | cflags: [ |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 5 | "-Wall", |
| 6 | "-Wextra", |
| 7 | "-Werror", |
| 8 | ], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 9 | shared_libs: [ |
| 10 | "libbase", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 11 | ], |
Christopher Ferris | 47dea71 | 2017-05-03 17:34:29 -0700 | [diff] [blame] | 12 | |
| 13 | target: { |
| 14 | android: { |
| 15 | static_libs: ["libasync_safe"], |
| 16 | }, |
| 17 | host: { |
| 18 | shared_libs: ["liblog"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 19 | }, |
Christopher Ferris | 47dea71 | 2017-05-03 17:34:29 -0700 | [diff] [blame] | 20 | }, |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 21 | } |
| 22 | |
Colin Cross | 51e6c25 | 2018-02-27 16:00:00 -0800 | [diff] [blame] | 23 | cc_library { |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 24 | name: "libmemunreachable", |
| 25 | defaults: ["libmemunreachable_defaults"], |
| 26 | srcs: [ |
| 27 | "Allocator.cpp", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 28 | "Binder.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 29 | "HeapWalker.cpp", |
| 30 | "LeakFolding.cpp", |
| 31 | "LeakPipe.cpp", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 32 | "MemUnreachable.cpp", |
| 33 | "ProcessMappings.cpp", |
| 34 | "PtracerThread.cpp", |
| 35 | "ThreadCapture.cpp", |
| 36 | ], |
| 37 | |
| 38 | static_libs: [ |
| 39 | "libc_malloc_debug_backtrace", |
Yabin Cui | 3841acc | 2018-05-10 17:19:12 -0700 | [diff] [blame] | 40 | "libprocinfo", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 41 | ], |
| 42 | // Only need this for arm since libc++ uses its own unwind code that |
| 43 | // doesn't mix with the other default unwind code. |
| 44 | arch: { |
| 45 | arm: { |
| 46 | static_libs: ["libunwind_llvm"], |
| 47 | }, |
| 48 | }, |
| 49 | export_include_dirs: ["include"], |
| 50 | local_include_dirs: ["include"], |
Colin Cross | 086e33f | 2019-05-17 14:11:14 -0700 | [diff] [blame^] | 51 | version_script: "libmemunreachable.map", |
| 52 | } |
| 53 | |
| 54 | // Integration test that runs against the public API of libmemunreachable |
| 55 | cc_test { |
| 56 | name: "memunreachable_test", |
| 57 | defaults: ["libmemunreachable_defaults"], |
| 58 | srcs: [ |
| 59 | "tests/MemUnreachable_test.cpp", |
| 60 | ], |
| 61 | shared_libs: ["libmemunreachable"], |
| 62 | |
| 63 | test_suites: ["device-tests"], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | cc_test { |
Colin Cross | 086e33f | 2019-05-17 14:11:14 -0700 | [diff] [blame^] | 67 | name: "memunreachable_unit_test", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 68 | defaults: ["libmemunreachable_defaults"], |
| 69 | host_supported: true, |
| 70 | srcs: [ |
| 71 | "tests/Allocator_test.cpp", |
| 72 | "tests/HeapWalker_test.cpp", |
| 73 | "tests/LeakFolding_test.cpp", |
| 74 | ], |
| 75 | |
| 76 | target: { |
| 77 | android: { |
| 78 | srcs: [ |
| 79 | "tests/DisableMalloc_test.cpp", |
| 80 | "tests/MemUnreachable_test.cpp", |
| 81 | "tests/ThreadCapture_test.cpp", |
| 82 | ], |
Colin Cross | 086e33f | 2019-05-17 14:11:14 -0700 | [diff] [blame^] | 83 | static_libs: [ |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 84 | "libmemunreachable", |
Colin Cross | 086e33f | 2019-05-17 14:11:14 -0700 | [diff] [blame^] | 85 | "libc_malloc_debug_backtrace", |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 86 | ], |
| 87 | }, |
| 88 | host: { |
| 89 | srcs: [ |
| 90 | "Allocator.cpp", |
| 91 | "HeapWalker.cpp", |
| 92 | "LeakFolding.cpp", |
| 93 | "tests/HostMallocStub.cpp", |
| 94 | ], |
| 95 | }, |
| 96 | darwin: { |
| 97 | enabled: false, |
| 98 | }, |
| 99 | }, |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 100 | |
| 101 | test_suites: ["device-tests"], |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 102 | } |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 103 | |
| 104 | cc_test { |
| 105 | name: "memunreachable_binder_test", |
| 106 | defaults: ["libmemunreachable_defaults"], |
| 107 | srcs: [ |
| 108 | "tests/Binder_test.cpp", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 109 | ], |
Colin Cross | 51e6c25 | 2018-02-27 16:00:00 -0800 | [diff] [blame] | 110 | static_libs: ["libmemunreachable"], |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 111 | shared_libs: [ |
| 112 | "libbinder", |
| 113 | "libhwbinder", |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 114 | "libutils", |
| 115 | ], |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 116 | test_suites: ["device-tests"], |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 117 | } |