1LOCAL_PATH := $(call my-dir)
2
3memunreachable_srcs := \
4   Allocator.cpp \
5   HeapWalker.cpp \
6   LeakFolding.cpp \
7   LeakPipe.cpp \
8   LineBuffer.cpp \
9   MemUnreachable.cpp \
10   ProcessMappings.cpp \
11   PtracerThread.cpp \
12   ThreadCapture.cpp \
13
14memunreachable_test_srcs := \
15   tests/Allocator_test.cpp \
16   tests/DisableMalloc_test.cpp \
17   tests/HeapWalker_test.cpp \
18   tests/LeakFolding_test.cpp \
19   tests/MemUnreachable_test.cpp \
20   tests/ThreadCapture_test.cpp \
21
22include $(CLEAR_VARS)
23
24LOCAL_MODULE := libmemunreachable
25LOCAL_SRC_FILES := $(memunreachable_srcs)
26LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
27LOCAL_SHARED_LIBRARIES := libbase liblog
28LOCAL_STATIC_LIBRARIES := libc_malloc_debug_backtrace libc_logging
29# Only need this for arm since libc++ uses its own unwind code that
30# doesn't mix with the other default unwind code.
31LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
32LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
33LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
34LOCAL_CLANG := true
35
36include $(BUILD_SHARED_LIBRARY)
37
38include $(CLEAR_VARS)
39
40LOCAL_MODULE := memunreachable_test
41LOCAL_SRC_FILES := $(memunreachable_test_srcs)
42LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
43LOCAL_CLANG := true
44LOCAL_SHARED_LIBRARIES := libmemunreachable libbase liblog
45
46include $(BUILD_NATIVE_TEST)
47
48include $(CLEAR_VARS)
49
50LOCAL_MODULE := memunreachable_test
51LOCAL_SRC_FILES := \
52   Allocator.cpp \
53   HeapWalker.cpp  \
54   LeakFolding.cpp \
55   tests/Allocator_test.cpp \
56   tests/HeapWalker_test.cpp \
57   tests/HostMallocStub.cpp \
58   tests/LeakFolding_test.cpp \
59
60LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
61LOCAL_CLANG := true
62LOCAL_SHARED_LIBRARIES := libbase liblog
63LOCAL_MODULE_HOST_OS := linux
64
65include $(BUILD_HOST_NATIVE_TEST)
66