Bug 1081000 - Build xpt tests without a dependency on xul, mozalloc and mozglue. r=bsmedberg
--- a/xpcom/typelib/xpt/moz.build
+++ b/xpcom/typelib/xpt/moz.build
@@ -24,8 +24,15 @@ FINAL_LIBRARY = 'xul'
GENERATED_INCLUDES += ['/xpcom/base']
LOCAL_INCLUDES += ['/xpcom/base']
FAIL_ON_WARNINGS = True
if CONFIG['_MSC_VER']:
CFLAGS += ['-Zl']
+
+# Code with FINAL_LIBRARY = 'xul' shouldn't do this, but the code
+# here doesn't use moz_malloc functions anyways, while not setting
+# MOZ_NO_MOZALLOC makes the code include mozalloc.h, which includes
+# inline operator new definitions that MSVC linker doesn't strip
+# when linking the xpt tests without mozalloc.
+DEFINES['MOZ_NO_MOZALLOC'] = True
--- a/xpcom/typelib/xpt/tests/Makefile.in
+++ b/xpcom/typelib/xpt/tests/Makefile.in
@@ -1,8 +1,6 @@
#
# 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 $(topsrcdir)/config/rules.mk
-
-DEFINES += -DIMPL_LIBXUL
+MOZ_GLUE_LDFLAGS =
--- a/xpcom/typelib/xpt/tests/moz.build
+++ b/xpcom/typelib/xpt/tests/moz.build
@@ -7,12 +7,10 @@
SimplePrograms([
'PrimitiveTest',
'SimpleTypeLib',
])
FAIL_ON_WARNINGS = True
USE_LIBS += [
- 'mozalloc',
'xpt',
- 'xul',
]