blob: 62a7266a5b37787bd547281f70875f954a944b71 [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",
Colin Cross05719702019-05-17 13:44:01 -070025 vendor_available: true,
Dan Willemsen194edf72016-08-26 15:01:36 -070026 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",
Dan Willemsen194edf72016-08-26 15:01:36 -070033 "MemUnreachable.cpp",
34 "ProcessMappings.cpp",
35 "PtracerThread.cpp",
36 "ThreadCapture.cpp",
37 ],
38
39 static_libs: [
40 "libc_malloc_debug_backtrace",
Yabin Cui3841acc2018-05-10 17:19:12 -070041 "libprocinfo",
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"],
Colin Cross086e33f2019-05-17 14:11:14 -070052 version_script: "libmemunreachable.map",
53}
54
55// Integration test that runs against the public API of libmemunreachable
56cc_test {
57 name: "memunreachable_test",
58 defaults: ["libmemunreachable_defaults"],
59 srcs: [
60 "tests/MemUnreachable_test.cpp",
61 ],
62 shared_libs: ["libmemunreachable"],
63
64 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -070065}
66
67cc_test {
Colin Cross086e33f2019-05-17 14:11:14 -070068 name: "memunreachable_unit_test",
Dan Willemsen194edf72016-08-26 15:01:36 -070069 defaults: ["libmemunreachable_defaults"],
70 host_supported: true,
71 srcs: [
72 "tests/Allocator_test.cpp",
73 "tests/HeapWalker_test.cpp",
74 "tests/LeakFolding_test.cpp",
75 ],
76
77 target: {
78 android: {
79 srcs: [
80 "tests/DisableMalloc_test.cpp",
81 "tests/MemUnreachable_test.cpp",
82 "tests/ThreadCapture_test.cpp",
83 ],
Colin Cross086e33f2019-05-17 14:11:14 -070084 static_libs: [
Dan Willemsen194edf72016-08-26 15:01:36 -070085 "libmemunreachable",
Colin Cross086e33f2019-05-17 14:11:14 -070086 "libc_malloc_debug_backtrace",
Dan Willemsen194edf72016-08-26 15:01:36 -070087 ],
88 },
89 host: {
90 srcs: [
91 "Allocator.cpp",
92 "HeapWalker.cpp",
93 "LeakFolding.cpp",
94 "tests/HostMallocStub.cpp",
95 ],
96 },
97 darwin: {
98 enabled: false,
99 },
100 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700101
102 test_suites: ["device-tests"],
Dan Willemsen194edf72016-08-26 15:01:36 -0700103}
Colin Crossf572b912017-06-20 18:07:29 -0700104
105cc_test {
106 name: "memunreachable_binder_test",
107 defaults: ["libmemunreachable_defaults"],
108 srcs: [
109 "tests/Binder_test.cpp",
Colin Crossf572b912017-06-20 18:07:29 -0700110 ],
Colin Cross51e6c252018-02-27 16:00:00 -0800111 static_libs: ["libmemunreachable"],
Colin Crossf572b912017-06-20 18:07:29 -0700112 shared_libs: [
113 "libbinder",
114 "libhwbinder",
Colin Crossf572b912017-06-20 18:07:29 -0700115 "libutils",
116 ],
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700117 test_suites: ["device-tests"],
Colin Crossf572b912017-06-20 18:07:29 -0700118}