blob: 826a576e6268108b7dd3da0a04f7d6fa78430cf3 [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",
Dan Willemsen194edf72016-08-26 15:01:36 -070012 ],
Christopher Ferris47dea712017-05-03 17:34:29 -070013
14 target: {
15 android: {
16 static_libs: ["libasync_safe"],
17 },
18 host: {
19 shared_libs: ["liblog"],
20 }
21 },
Dan Willemsen194edf72016-08-26 15:01:36 -070022}
23
24cc_library_shared {
25 name: "libmemunreachable",
26 defaults: ["libmemunreachable_defaults"],
27 srcs: [
28 "Allocator.cpp",
Colin Crossf572b912017-06-20 18:07:29 -070029 "Binder.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070030 "HeapWalker.cpp",
31 "LeakFolding.cpp",
32 "LeakPipe.cpp",
33 "LineBuffer.cpp",
34 "MemUnreachable.cpp",
35 "ProcessMappings.cpp",
36 "PtracerThread.cpp",
37 "ThreadCapture.cpp",
38 ],
39
40 static_libs: [
41 "libc_malloc_debug_backtrace",
Dan Willemsen194edf72016-08-26 15:01:36 -070042 ],
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"],
52}
53
54cc_test {
55 name: "memunreachable_test",
56 defaults: ["libmemunreachable_defaults"],
57 host_supported: true,
58 srcs: [
59 "tests/Allocator_test.cpp",
60 "tests/HeapWalker_test.cpp",
61 "tests/LeakFolding_test.cpp",
62 ],
63
64 target: {
65 android: {
66 srcs: [
67 "tests/DisableMalloc_test.cpp",
68 "tests/MemUnreachable_test.cpp",
69 "tests/ThreadCapture_test.cpp",
70 ],
71 shared_libs: [
72 "libmemunreachable",
73 ],
74 },
75 host: {
76 srcs: [
77 "Allocator.cpp",
78 "HeapWalker.cpp",
79 "LeakFolding.cpp",
80 "tests/HostMallocStub.cpp",
81 ],
82 },
83 darwin: {
84 enabled: false,
85 },
86 },
87}
Colin Crossf572b912017-06-20 18:07:29 -070088
89cc_test {
90 name: "memunreachable_binder_test",
91 defaults: ["libmemunreachable_defaults"],
92 srcs: [
93 "tests/Binder_test.cpp",
94 "tests/MemUnreachable_test.cpp",
95 ],
96 shared_libs: [
97 "libbinder",
98 "libhwbinder",
99 "libmemunreachable",
100 "libutils",
101 ],
102}