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
Родитель cd4191e248
Коммит f7bf25fd88
6 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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.

Просмотреть файл

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

Просмотреть файл

@ -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__':

Просмотреть файл

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

Просмотреть файл

@ -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__':