blob: c32a45fdc5edbe0fd0f8aae4b1bb75031d589c80 [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"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080019 },
Christopher Ferris47dea712017-05-03 17:34:29 -070020 },
Dan Willemsen194edf72016-08-26 15:01:36 -070021}
22
Colin Cross51e6c252018-02-27 16:00:00 -080023cc_library {
Dan Willemsen194edf72016-08-26 15:01:36 -070024 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",
Dan Willemsen194edf72016-08-26 15:01:36 -070032 "MemUnreachable.cpp",
33 "ProcessMappings.cpp",
34 "PtracerThread.cpp",
35 "ThreadCapture.cpp",
36 ],
37
38 static_libs: [
39 "libc_malloc_debug_backtrace",
Yabin Cui3841acc2018-05-10 17:19:12 -070040 "libprocinfo",
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"],
Colin Cross086e33f2019-05-17 14:11:14 -070051 version_script: "libmemunreachable.map",
52}
53
54// Integration test that runs against the public API of libmemunreachable
55cc_test {
56 name: "memunreachable_test",
57 defaults: ["libmemunreachable_defaults"],
58 srcs: [
59 "tests/MemUnreachable_test.cpp",
60 ],
61 shared_libs: ["libmemunreachable"],
62
63 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070064}
65
66cc_test {
Colin Cross086e33f2019-05-17 14:11:14 -070067 name: "memunreachable_unit_test",
Dan Willemsen194edf72016-08-26 15:01:36 -070068 defaults: ["libmemunreachable_defaults"],
69 host_supported: true,
70 srcs: [
71 "tests/Allocator_test.cpp",
72 "tests/HeapWalker_test.cpp",
73 "tests/LeakFolding_test.cpp",
74 ],
75
76 target: {
77 android: {
78 srcs: [
79 "tests/DisableMalloc_test.cpp",
80 "tests/MemUnreachable_test.cpp",
81 "tests/ThreadCapture_test.cpp",
82 ],
Colin Cross086e33f2019-05-17 14:11:14 -070083 static_libs: [
Dan Willemsen194edf72016-08-26 15:01:36 -070084 "libmemunreachable",
Colin Cross086e33f2019-05-17 14:11:14 -070085 "libc_malloc_debug_backtrace",
Dan Willemsen194edf72016-08-26 15:01:36 -070086 ],
87 },
88 host: {
89 srcs: [
90 "Allocator.cpp",
91 "HeapWalker.cpp",
92 "LeakFolding.cpp",
93 "tests/HostMallocStub.cpp",
94 ],
95 },
96 darwin: {
97 enabled: false,
98 },
99 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700100
101 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -0700102}
Colin Crossf572b912017-06-20 18:07:29 -0700103
104cc_test {
105 name: "memunreachable_binder_test",
106 defaults: ["libmemunreachable_defaults"],
107 srcs: [
108 "tests/Binder_test.cpp",
Colin Crossf572b912017-06-20 18:07:29 -0700109 ],
Colin Cross51e6c252018-02-27 16:00:00 -0800110 static_libs: ["libmemunreachable"],
Colin Crossf572b912017-06-20 18:07:29 -0700111 shared_libs: [
112 "libbinder",
113 "libhwbinder",
Colin Crossf572b912017-06-20 18:07:29 -0700114 "libutils",
115 ],
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700116 test_suites: ["device-tests"],
Colin Crossf572b912017-06-20 18:07:29 -0700117}