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"], |
| 19 | } |
| 20 | }, |
Dan Willemsen | 194edf7 | 2016-08-26 15:01:36 -0700 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | cc_library_shared { |
| 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", |
| 32 | "LineBuffer.cpp", |
| 33 | "MemUnreachable.cpp", |
| 34 | "ProcessMappings.cpp", |
| 35 | "PtracerThread.cpp", |
| 36 | "ThreadCapture.cpp", |
| 37 | ], |
| 38 | |
| 39 | static_libs: [ |
| 40 | "libc_malloc_debug_backtrace", |
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"], |
| 51 | } |
| 52 | |
| 53 | cc_test { |
| 54 | name: "memunreachable_test", |
| 55 | defaults: ["libmemunreachable_defaults"], |
| 56 | host_supported: true, |
| 57 | srcs: [ |
| 58 | "tests/Allocator_test.cpp", |
| 59 | "tests/HeapWalker_test.cpp", |
| 60 | "tests/LeakFolding_test.cpp", |
| 61 | ], |
| 62 | |
| 63 | target: { |
| 64 | android: { |
| 65 | srcs: [ |
| 66 | "tests/DisableMalloc_test.cpp", |
| 67 | "tests/MemUnreachable_test.cpp", |
| 68 | "tests/ThreadCapture_test.cpp", |
| 69 | ], |
| 70 | shared_libs: [ |
| 71 | "libmemunreachable", |
| 72 | ], |
| 73 | }, |
| 74 | host: { |
| 75 | srcs: [ |
| 76 | "Allocator.cpp", |
| 77 | "HeapWalker.cpp", |
| 78 | "LeakFolding.cpp", |
| 79 | "tests/HostMallocStub.cpp", |
| 80 | ], |
| 81 | }, |
| 82 | darwin: { |
| 83 | enabled: false, |
| 84 | }, |
| 85 | }, |
| 86 | } |
Colin Cross | f572b91 | 2017-06-20 18:07:29 -0700 | [diff] [blame] | 87 | |
| 88 | cc_test { |
| 89 | name: "memunreachable_binder_test", |
| 90 | defaults: ["libmemunreachable_defaults"], |
| 91 | srcs: [ |
| 92 | "tests/Binder_test.cpp", |
| 93 | "tests/MemUnreachable_test.cpp", |
| 94 | ], |
| 95 | shared_libs: [ |
| 96 | "libbinder", |
| 97 | "libhwbinder", |
| 98 | "libmemunreachable", |
| 99 | "libutils", |
| 100 | ], |
| 101 | } |