Skip to content

Commit

Permalink
Bug 1221819 - Move common gtest setup to single file, r=jld
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 288404bbd9a03446c559ad459016f7eebc725b88
  • Loading branch information
martinthomson committed Nov 19, 2015
1 parent 5047139 commit 0ad6b1f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 42 deletions.
27 changes: 27 additions & 0 deletions external_tests/common/gtest.mk
@@ -0,0 +1,27 @@
#! gmake
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

include ../../cmd/platlibs.mk
include ../../cmd/platrules.mk

MKPROG = $(CCC)
MKSHLIB = $(CCC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)

ifeq (WINNT,$(OS_ARCH))
# -EHsc because gtest has exception handlers
OS_CFLAGS += -EHsc -nologo
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
OS_CFLAGS += -DNOMINMAX

# Linking to winsock to get htonl
OS_LIBS += Ws2_32.lib

# On windows, we need to create the parent directory
# Needed because we include files from a subdirectory
MAKE_OBJDIR = $(INSTALL) -D $(dir $@)
else
CXXFLAGS += -std=c++0x
endif
10 changes: 1 addition & 9 deletions external_tests/google_test/Makefile
Expand Up @@ -26,6 +26,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################

include ../common/gtest.mk

#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
Expand All @@ -41,12 +42,3 @@ include $(CORE_DEPTH)/coreconf/rules.mk
#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

MKSHLIB = $(CCC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
ifeq (WINNT,$(OS_ARCH))
# -EHsc because gtest has exception handlers
OS_CFLAGS += -EHsc
# On windows, we need to create the parent directory
# Needed because we include files from a subdirectory
MAKE_OBJDIR = $(INSTALL) -D $(dir $@)
endif
18 changes: 1 addition & 17 deletions external_tests/pk11_gtest/Makefile
Expand Up @@ -25,7 +25,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################

include ../../cmd/platlibs.mk
include ../common/gtest.mk

#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
Expand All @@ -42,19 +42,3 @@ include $(CORE_DEPTH)/coreconf/rules.mk
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

MKPROG = $(CCC)
CFLAGS += -I$(CORE_DEPTH)/lib/ssl

include ../../cmd/platrules.mk

ifeq (WINNT,$(OS_ARCH))
# -EHsc because gtest has exception handlers
OS_CFLAGS += -EHsc -nologo
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
OS_CFLAGS += -DNOMINMAX

# Linking to winsock to get htonl
OS_LIBS += Ws2_32.lib
else
CXXFLAGS += -std=c++0x
endif
17 changes: 1 addition & 16 deletions external_tests/ssl_gtest/Makefile
Expand Up @@ -25,7 +25,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################

include ../../cmd/platlibs.mk
include ../common/gtest.mk

#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
Expand All @@ -42,19 +42,4 @@ include $(CORE_DEPTH)/coreconf/rules.mk
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

MKPROG = $(CCC)
CFLAGS += -I$(CORE_DEPTH)/lib/ssl

include ../../cmd/platrules.mk

ifeq (WINNT,$(OS_ARCH))
# -EHsc because gtest has exception handlers
OS_CFLAGS += -EHsc -nologo
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
OS_CFLAGS += -DNOMINMAX

# Linking to winsock to get htonl
OS_LIBS += Ws2_32.lib
else
CXXFLAGS += -std=c++0x
endif

0 comments on commit 0ad6b1f

Please sign in to comment.