Commit ea9bf78d authored by Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Bug 290526 Fix gtests build for WIN% targets r=rrelyea

The google_test gtest build doesn't provide any exports for the
shared library on Windows and the gyp build also builds just a
static library. So build gtest and gtestutil libraries as static.

For whatever reason, the Windows linker doesn't find the main
function inside the gtestutil library, if we don't tell it to
build a console executable. But linking works fine, if the object
file is used directly. But since we can have different main()
objects based on build flags, we enforce building console
applications binaries.

Differential Revision: https://phabricator.services.mozilla.com/D70665

--HG--
extra : moz-landing-system : lando
parent b4ab574f
......@@ -187,6 +187,8 @@ endif
endif
# Purify requires /FIXED:NO when linking EXEs.
LDFLAGS += /FIXED:NO
# So the linker will find main in the gtestutil library
LDFLAGS += -SUBSYSTEM:CONSOLE
endif
ifneq ($(_MSC_VER),$(_MSC_VER_6))
# NSS has too many of these to fix, downgrade the warning
......
......@@ -21,4 +21,4 @@ REQUIRES = nspr nss libdbm gtest
PROGRAM = certdb_gtest
EXTRA_LIBS = $(DIST)/lib/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) $(EXTRA_OBJS) \
../common/$(OBJDIR)/gtests$(OBJ_SUFFIX)
$(DIST)/lib/$(LIB_PREFIX)gtestutil.$(LIB_SUFFIX)
......@@ -20,6 +20,9 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (3) Include "component" configuration information. (OPTIONAL) #
#######################################################################
SHARED_LIBRARY = $(NULL)
IMPORT_LIBRARY = $(NULL)
#######################################################################
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################
......
......@@ -20,7 +20,8 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (3) Include "component" configuration information. (OPTIONAL) #
#######################################################################
SHARED_LIBRARY = $(NULL)
IMPORT_LIBRARY = $(NULL)
#######################################################################
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
......
......@@ -6,8 +6,8 @@ CORE_DEPTH = ../..
DEPTH = ../..
MODULE = gtest
LIBRARY_NAME = gtest
LIBRARY_VERSION = 1
INCLUDES += -Igtest/include/ -Igtest
......
......@@ -20,6 +20,8 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (3) Include "component" configuration information. (OPTIONAL) #
#######################################################################
LIBRARY = $(NULL)
IMPORT_LIBRARY = $(NULL)
#######################################################################
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment