google_x86_googletest.mk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # CHRE GoogleTest Build Variant
  3. #
  4. include $(CHRE_PREFIX)/build/clean_build_template_args.mk
  5. TARGET_NAME = google_x86_googletest
  6. TARGET_CFLAGS = -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=2048
  7. TARGET_VARIANT_SRCS = $(GOOGLE_X86_GOOGLETEST_SRCS)
  8. TARGET_VARIANT_SRCS += $(GOOGLETEST_SRCS)
  9. TARGET_PLATFORM_ID = 0x476f6f676c000001
  10. TARGET_CFLAGS += $(SIM_CFLAGS)
  11. TARGET_VARIANT_SRCS += $(SIM_SRCS)
  12. # Add a symbol to determine when building for a test.
  13. TARGET_CFLAGS += -DGTEST
  14. # Ignore sign comparison warnings triggered by EXPECT/ASSERT macros in tests
  15. # (typically, unsigned value vs. implicitly signed literal)
  16. TARGET_CFLAGS += -Wno-sign-compare
  17. # Ignore missing field initializers as googletest will not compile with this
  18. # warning enabled.
  19. TARGET_CFLAGS += -Wno-missing-field-initializers
  20. TARGET_SO_LATE_LIBS = $(GOOGLE_X86_GOOGLETEST_LATE_LIBS)
  21. ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)
  22. ifeq ($(ANDROID_BUILD_TOP),)
  23. $(error "You should supply an ANDROID_BUILD_TOP environment variable \
  24. containing a path to the Android source tree. This is typically \
  25. provided by initializing the Android build environment.")
  26. endif
  27. export GOOGLETEST_PREFIX=$(ANDROID_BUILD_TOP)/external/googletest
  28. include $(CHRE_PREFIX)/build/arch/x86.mk
  29. TARGET_CFLAGS += $(GOOGLETEST_CFLAGS)
  30. TARGET_CFLAGS += $(GOOGLE_X86_GOOGLETEST_CFLAGS)
  31. # Instruct the build to link a final executable.
  32. TARGET_BUILD_BIN = true
  33. # Link in libraries for the final executable.
  34. TARGET_BIN_LDFLAGS += -lrt -ldl
  35. TARGET_BIN_LDFLAGS += -lpthread
  36. TARGET_BIN_LDFLAGS += $(shell pkg-config --libs sndfile)
  37. include $(CHRE_PREFIX)/build/build_template.mk
  38. endif