platform_build/core/host_native_test.mk
Elliott Hughes 52e52d1447 gtest needs -lpthread.
Host gtests that don't use pthreads themselves need to be linked
against libpthread because gtest itself uses pthreads to ensure
thread-safety. (It can't know in advance whether the code under
test is going to spin up threads, so it has to be pessimistic.)

Change-Id: I14fb1098c163d7fe6ae9a9a0314acead4ec9383d
2014-01-28 17:32:30 -08:00

15 lines
456 B
Makefile

################################################
## A thin wrapper around BUILD_HOST_EXECUTABLE
## Common flags for host native tests are added.
################################################
LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING -O0 -g
LOCAL_C_INCLUDES += \
external/gtest/include
LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host
LOCAL_SHARED_LIBRARIES +=
LOCAL_LDFLAGS += -lpthread
include $(BUILD_HOST_EXECUTABLE)