blob: 8b76a6513368eb73e9f896ab217269507e122033 [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 ],
Dan Willemsen194edf72016-08-26 15:01:36 -07009 shared_libs: [
10 "libbase",
Dan Willemsen194edf72016-08-26 15:01:36 -070011 ],
Christopher Ferris47dea712017-05-03 17:34:29 -070012
13 target: {
14 android: {
15 static_libs: ["libasync_safe"],
16 },
17 host: {
18 shared_libs: ["liblog"],
19 }
20 },
Dan Willemsen194edf72016-08-26 15:01:36 -070021}
22
23cc_library_shared {
24 name: "libmemunreachable",
25 defaults: ["libmemunreachable_defaults"],
26 srcs: [
27 "Allocator.cpp",
Colin Crossf572b912017-06-20 18:07:29 -070028 "Binder.cpp",
Dan Willemsen194edf72016-08-26 15:01:36 -070029 "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 Willemsen194edf72016-08-26 15:01:36 -070041 ],
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
53cc_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 Crossf572b912017-06-20 18:07:29 -070087
88cc_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}