blob: 2867f6495d9cdca586adb8742a1991750e79b31b [file] [log] [blame]
Dan Willemsen194edf72016-08-26 15:01:36 -07001cc_defaults {
2 name: "libmemunreachable_defaults",
3
4 cflags: [
Dan Willemsen194edf72016-08-26 15:01:36 -07005 "-Wall",
6 "-Wextra",
7 "-Werror",
8 ],
9 clang: true,
10 shared_libs: [
11 "libbase",
12 "liblog",
13 ],
14}
15
16cc_library_shared {
17 name: "libmemunreachable",
18 defaults: ["libmemunreachable_defaults"],
19 srcs: [
20 "Allocator.cpp",
21 "HeapWalker.cpp",
22 "LeakFolding.cpp",
23 "LeakPipe.cpp",
24 "LineBuffer.cpp",
25 "MemUnreachable.cpp",
26 "ProcessMappings.cpp",
27 "PtracerThread.cpp",
28 "ThreadCapture.cpp",
29 ],
30
31 static_libs: [
32 "libc_malloc_debug_backtrace",
Dan Willemsen194edf72016-08-26 15:01:36 -070033 ],
34 // Only need this for arm since libc++ uses its own unwind code that
35 // doesn't mix with the other default unwind code.
36 arch: {
37 arm: {
38 static_libs: ["libunwind_llvm"],
39 },
40 },
41 export_include_dirs: ["include"],
42 local_include_dirs: ["include"],
43}
44
45cc_test {
46 name: "memunreachable_test",
47 defaults: ["libmemunreachable_defaults"],
48 host_supported: true,
49 srcs: [
50 "tests/Allocator_test.cpp",
51 "tests/HeapWalker_test.cpp",
52 "tests/LeakFolding_test.cpp",
53 ],
54
55 target: {
56 android: {
57 srcs: [
58 "tests/DisableMalloc_test.cpp",
59 "tests/MemUnreachable_test.cpp",
60 "tests/ThreadCapture_test.cpp",
61 ],
62 shared_libs: [
63 "libmemunreachable",
64 ],
65 },
66 host: {
67 srcs: [
68 "Allocator.cpp",
69 "HeapWalker.cpp",
70 "LeakFolding.cpp",
71 "tests/HostMallocStub.cpp",
72 ],
73 },
74 darwin: {
75 enabled: false,
76 },
77 },
78}