Bug 1081000 - Build xpt tests without a dependency on xul, mozalloc and mozglue. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 14 Oct 2014 07:14:13 +0900
changeset 210254 085b4adb56b07a2a05007bb1082fee5210905db1
parent 210253 c0df45ff2944812bcfc86f2428633128c42e5f5f
child 210255 a3ea5b08baba6e217386d0b452366d12093bfab9
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbsmedberg
bugs1081000
milestone35.0a1
Bug 1081000 - Build xpt tests without a dependency on xul, mozalloc and mozglue. r=bsmedberg
xpcom/typelib/xpt/moz.build
xpcom/typelib/xpt/tests/Makefile.in
xpcom/typelib/xpt/tests/moz.build
--- 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',
 ]