зеркало из https://github.com/mozilla/gecko-dev.git
Bug 818246 - Part 8: Support XPIDL_FLAGS in moz.build; r=gps
This commit is contained in:
Родитель
cd4191e248
Коммит
f7bf25fd88
|
@ -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__':
|
||||
|
|
Загрузка…
Ссылка в новой задаче