| Index: Source/bindings/scripts/idl_compiler.py
|
| diff --git a/Source/bindings/scripts/idl_compiler.py b/Source/bindings/scripts/idl_compiler.py
|
| index a339be30bc5f188fa46e2e1028b19221f1dfc8c0..6728aff45c10cadb38a7d536c0c5c8e7dd531e08 100755
|
| --- a/Source/bindings/scripts/idl_compiler.py
|
| +++ b/Source/bindings/scripts/idl_compiler.py
|
| @@ -45,6 +45,8 @@ from utilities import write_file
|
|
|
| def parse_options():
|
| parser = OptionParser()
|
| + parser.add_option('--cache-directory',
|
| + help='cache directory, defaults to output directory')
|
| parser.add_option('--output-directory')
|
| parser.add_option('--interfaces-info-file')
|
| parser.add_option('--write-file-only-if-changed', type='int')
|
| @@ -77,9 +79,9 @@ class IdlCompiler(object):
|
| """
|
| __metaclass__ = abc.ABCMeta
|
|
|
| - def __init__(self, output_directory, code_generator=None,
|
| - interfaces_info=None, interfaces_info_filename='',
|
| - only_if_changed=False):
|
| + def __init__(self, output_directory, cache_directory='',
|
| + code_generator=None, interfaces_info=None,
|
| + interfaces_info_filename='', only_if_changed=False):
|
| """
|
| Args:
|
| interfaces_info:
|
| @@ -87,6 +89,8 @@ class IdlCompiler(object):
|
| (avoids auxiliary file in run-bindings-tests)
|
| interfaces_info_file: filename of pickled interfaces_info
|
| """
|
| + cache_directory = cache_directory or output_directory
|
| + self.cache_directory = cache_directory
|
| self.code_generator = code_generator
|
| if interfaces_info_filename:
|
| with open(interfaces_info_filename) as interfaces_info_file:
|
| @@ -94,7 +98,7 @@ class IdlCompiler(object):
|
| self.interfaces_info = interfaces_info
|
| self.only_if_changed = only_if_changed
|
| self.output_directory = output_directory
|
| - self.reader = IdlReader(interfaces_info, output_directory)
|
| + self.reader = IdlReader(interfaces_info, cache_directory)
|
|
|
| def compile_and_write(self, idl_filename, output_filenames):
|
| interface_name = idl_filename_to_interface_name(idl_filename)
|
| @@ -114,7 +118,7 @@ class IdlCompilerV8(IdlCompiler):
|
| def __init__(self, *args, **kwargs):
|
| IdlCompiler.__init__(self, *args, **kwargs)
|
| self.code_generator = CodeGeneratorV8(self.interfaces_info,
|
| - self.output_directory)
|
| + self.cache_directory)
|
|
|
| def compile_file(self, idl_filename):
|
| interface_name = idl_filename_to_interface_name(idl_filename)
|
| @@ -129,6 +133,7 @@ def main():
|
| options, idl_filename = parse_options()
|
| idl_compiler = IdlCompilerV8(
|
| options.output_directory,
|
| + cache_directory=options.cache_directory,
|
| interfaces_info_filename=options.interfaces_info_file,
|
| only_if_changed=options.write_file_only_if_changed)
|
| idl_compiler.compile_file(idl_filename)
|
|
|