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