OSDN Git Service

am 318217a8: Enable building of gtest for Windows
authorAdam Lesinski <adamlesinski@google.com>
Tue, 21 Oct 2014 00:01:15 +0000 (00:01 +0000)
committerAndroid Git Automerger <android-git-automerger@android.com>
Tue, 21 Oct 2014 00:01:15 +0000 (00:01 +0000)
* commit '318217a84a05880f5e10ba2086f87eb0320772c7':
  Enable building of gtest for Windows

1  2 
core/host_test_internal.mk

@@@ -2,17 -2,17 +2,24 @@@
  ## Shared definitions for all host test compilations.
  #####################################################
  
- LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING -O0 -g
+ ifeq ($(HOST_OS),windows)
+ LOCAL_CFLAGS += -DGTEST_OS_WINDOWS
+ else
+ LOCAL_CFLAGS += -DGTEST_OS_LINUX
+ LOCAL_LDLIBS += -lpthread
+ endif
+ LOCAL_CFLAGS += -DGTEST_HAS_STD_STRING -O0 -g
  LOCAL_C_INCLUDES +=  external/gtest/include
  
 -ifneq ($(filter libc++,$(LOCAL_SHARED_LIBRARIES)),)
 +my_test_libcxx := false
 +ifeq (,$(TARGET_BUILD_APPS))
 +ifneq ($(filter $(strip $(LOCAL_CXX_STL)),libc++ libc++_static),)
 +my_test_libcxx := true
 +endif
 +endif
 +
 +ifeq ($(my_test_libcxx),true)
  LOCAL_STATIC_LIBRARIES += libgtest_libc++_host libgtest_main_libc++_host
  else
  LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host