Bug 818246 - Part 8: Support XPIDL_FLAGS in moz.build; r=gps

This commit is contained in:
Mike Shal 2013-03-12 10:09:00 -07:00
parent 2eb7c496cb
commit 568184706d
6 changed files with 22 additions and 2 deletions

View File

@ -78,6 +78,8 @@ class TreeMetadataEmitter(object):
passthru.variables['XPIDLSRCS'] = sandbox['XPIDL_SOURCES']
if sandbox['XPIDL_MODULE']:
passthru.variables['XPIDL_MODULE'] = sandbox['XPIDL_MODULE']
if sandbox['XPIDL_FLAGS']:
passthru.variables['XPIDL_FLAGS'] = sandbox['XPIDL_FLAGS']
if passthru.variables:
yield passthru

View File

@ -157,6 +157,14 @@ VARIABLES = {
XPIDL_SOURCES together. If unspecified, it defaults to be the same as
MODULE.
"""),
'XPIDL_FLAGS': (list, [],
"""XPCOM Interface Definition Module Flags.
This is a list of extra flags that are passed to the IDL compiler.
Typically this is a set of -I flags that denote extra include
directories to search for included .idl files.
"""),
}
# The set of functions exposed to the sandbox.

View File

@ -3,3 +3,4 @@
XPIDL_SOURCES = ['foo.idl', 'bar.idl', 'biz.idl']
XPIDL_MODULE = 'module_name'
XPIDL_FLAGS = ['-Idir1', '-Idir2', '-Idir3']

View File

@ -129,7 +129,12 @@ class TestRecursiveMakeBackend(BackendTester):
'XPIDLSRCS += bar.idl',
'XPIDLSRCS += biz.idl',
])
self.assertEqual(lines[5], 'XPIDL_MODULE := module_name')
self.assertEqual(lines[5:8], [
'XPIDL_FLAGS += -Idir1',
'XPIDL_FLAGS += -Idir2',
'XPIDL_FLAGS += -Idir3',
])
self.assertEqual(lines[8], 'XPIDL_MODULE := module_name')
if __name__ == '__main__':

View File

@ -3,3 +3,4 @@
XPIDL_SOURCES += ['foo.idl', 'bar.idl', 'biz.idl']
XPIDL_MODULE = 'module_name'
XPIDL_FLAGS += ['-Idir1', '-Idir2', '-Idir3']

View File

@ -121,12 +121,15 @@ class TestEmitterBasic(unittest.TestCase):
self.assertIsInstance(objs[1], VariablePassthru)
variables = objs[1].variables
self.assertEqual(len(variables), 2)
self.assertEqual(len(variables), 3)
self.assertIn('XPIDLSRCS', variables)
self.assertEqual(variables['XPIDLSRCS'],
['foo.idl', 'bar.idl', 'biz.idl'])
self.assertIn('XPIDL_MODULE', variables)
self.assertEqual(variables['XPIDL_MODULE'], 'module_name')
self.assertIn('XPIDL_FLAGS', variables)
self.assertEqual(variables['XPIDL_FLAGS'],
['-Idir1', '-Idir2', '-Idir3'])
if __name__ == '__main__':