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