Bug 906696 - Start moving testplugin.mk to moz.build; f=gps r=mshal
authorMs2ger <ms2ger@gmail.com>
Fri, 06 Sep 2013 08:40:37 +0200
changeset 145752 511fbeed2a3b1d7e2b77b00f061ecc78555a7b8e
parent 145751 90a17a78cf796bdad22513e2f842b44c3a93ed39
child 145753 8beb34543e7b431c256dafc7356645f9f75d8028
push id25224
push userMs2ger@gmail.com
push dateFri, 06 Sep 2013 06:44:32 +0000
treeherdermozilla-central@ab5f29823236 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs906696
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 906696 - Start moving testplugin.mk to moz.build; f=gps r=mshal
dom/plugins/test/testplugin/moz.build
dom/plugins/test/testplugin/secondplugin/moz.build
dom/plugins/test/testplugin/testplugin.mk
dom/plugins/test/testplugin/testplugin.mozbuild
--- a/dom/plugins/test/testplugin/moz.build
+++ b/dom/plugins/test/testplugin/moz.build
@@ -7,8 +7,11 @@
 DIRS += ['secondplugin']
 
 MODULE = 'nptest'
 NO_DIST_INSTALL = True
 
 LIBRARY_NAME = 'nptest'
 
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
+
+relative_path = '.'
+include('testplugin.mozbuild')
--- a/dom/plugins/test/testplugin/secondplugin/moz.build
+++ b/dom/plugins/test/testplugin/secondplugin/moz.build
@@ -3,8 +3,10 @@
 # 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/.
 
 MODULE = 'npsecondtest'
 
 LIBRARY_NAME = 'npsecondtest'
 
+relative_path = '..'
+include('../testplugin.mozbuild')
--- a/dom/plugins/test/testplugin/testplugin.mk
+++ b/dom/plugins/test/testplugin/testplugin.mk
@@ -11,51 +11,27 @@ STL_FLAGS =
 # must link statically with the CRT; nptest isn't Gecko code
 USE_STATIC_LIBS = 1
 
 # Need to custom install plugins
 NO_INSTALL = 1
 
 VPATH += $(topsrcdir)/build
 
-CPPSRCS   =  \
-  $(RELATIVE_PATH)/nptest.cpp \
-  $(RELATIVE_PATH)/nptest_utils.cpp \
-  nptest_name.cpp \
-  $(NULL)
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-CMMSRCS = $(RELATIVE_PATH)/nptest_macosx.mm
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-CPPSRCS += $(RELATIVE_PATH)/nptest_gtk2.cpp
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),android)
-CPPSRCS += $(RELATIVE_PATH)/nptest_droid.cpp
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
-CPPSRCS += $(RELATIVE_PATH)/nptest_os2.cpp
-endif
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
-CPPSRCS += $(RELATIVE_PATH)/nptest_qt.cpp
 include $(topsrcdir)/config/config.mk
 CXXFLAGS        += $(MOZ_QT_CFLAGS)
 CFLAGS          += $(MOZ_QT_CFLAGS)
 EXTRA_DSO_LDOPTS = \
                 $(MOZ_QT_LIBS) \
                 $(XLDFLAGS) \
                 $(XLIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-CPPSRCS  += $(RELATIVE_PATH)/nptest_windows.cpp
 RCFILE    = nptest.rc
 RESFILE   = nptest.res
 DEFFILE   = $(win_srcdir)/nptest.def
 OS_LIBS  += $(call EXPAND_LIBNAME,msimg32)
 
 # Windows opt builds without PGO break nptest.dll
 MOZ_OPTIMIZE=
 endif
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -0,0 +1,37 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+CPP_SOURCES += [
+    relative_path + '/nptest.cpp',
+    relative_path + '/nptest_utils.cpp',
+    'nptest_name.cpp',
+]
+
+toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
+if toolkit == 'cocoa':
+    CMMSRCS += [
+        relative_path + '/nptest_macosx.mm'
+    ]
+elif toolkit == 'gtk2':
+    CPP_SOURCES += [
+        relative_path + '/nptest_gtk2.cpp',
+    ]
+elif toolkit == 'android':
+    CPP_SOURCES += [
+        relative_path + '/nptest_droid.cpp',
+    ]
+elif toolkit == 'os2':
+    CPP_SOURCES += [
+        relative_path + '/nptest_os2.cpp',
+    ]
+elif toolkit == 'qt':
+    CPP_SOURCES += [
+        relative_path + '/nptest_qt.cpp',
+    ]
+elif toolkit == 'windows':
+    CPP_SOURCES += [
+        relative_path + '/nptest_windows.cpp',
+    ]