gtest.mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #! gmake
  2. #
  3. # This Source Code Form is subject to the terms of the Mozilla Public
  4. # License, v. 2.0. If a copy of the MPL was not distributed with this
  5. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. include $(CORE_DEPTH)/cmd/platlibs.mk
  7. MKPROG = $(CCC)
  8. MKSHLIB = $(CCC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
  9. # gtests pick up errors with signed/unsigned comparisons on some platforms
  10. # even though we disabled -Wsign-compare.
  11. # This catches that by enabling the warning.
  12. # Only add -Wsign-compare if -Werror is enabled, lest we add it on the wrong
  13. # platform.
  14. ifeq (-Werror,$(filter -Werror -Wsign-compare,$(WARNING_CFLAGS)))
  15. WARNING_CFLAGS += -Wsign-compare
  16. endif
  17. WARNING_CFLAGS := $(filter-out -w44018,$(WARNING_CFLAGS))
  18. ifeq (WINNT,$(OS_ARCH))
  19. # -EHsc because gtest has exception handlers
  20. OS_CFLAGS += -EHsc -nologo
  21. # http://www.suodenjoki.dk/us/archive/2010/min-max.htm
  22. OS_CFLAGS += -DNOMINMAX
  23. # Linking to winsock to get htonl
  24. OS_LIBS += Ws2_32.lib
  25. # On windows, we need to create the parent directory
  26. # Needed because we include files from a subdirectory
  27. MAKE_OBJDIR = $(INSTALL) -D $(dir $@)
  28. else
  29. CXXFLAGS += -std=c++0x
  30. endif