Bug 1459721 - part 5 - explicitly specify include directories for xpidl files; r=chmanchester

The previous patch required us to pass a single -I argument pointing at
$(DIST)/idl so IDL include statements would work correctly.  This patch
lifts that limitation and explicitly points xpidl-process.py at the
locations of all the IDL source directories to search for included IDL
files.  Invocations of xpidl-process.py no longer depend on IDL files
being copied to the objdir.
This commit is contained in:
Nathan Froyd 2018-05-15 10:05:24 -04:00
parent 236d75aaae
commit 2f6686cbec
4 changed files with 12 additions and 3 deletions

View File

@ -42,7 +42,7 @@ code_gen_deps := $(topsrcdir)/xpcom/reflect/xptinfo/perfecthash.py
$(process_py) --cache-dir $(DEPTH)/xpcom/idl-parser/xpidl --depsdir $(idl_deps_dir) \
--bindings-conf $(topsrcdir)/dom/bindings/Bindings.conf \
$(foreach dir,$($(basename $(notdir $@))_dirs),--input-dir $(dir)) \
-I $(dist_idl_dir) \
$(foreach dir,$(all_idl_dirs),-I $(dir)) \
$(dist_include_dir) $(dist_xpcrs_dir) $(@D) \
$(basename $(notdir $@)) $($(basename $(notdir $@))_deps)
# When some IDL is added or removed, if the actual IDL file was already, or

View File

@ -116,7 +116,8 @@ def main(argv):
help='Extra directories where to look for included .idl files.')
args = parser.parse_args(argv)
process(args.input_dirs, args.incpath, args.bindings_conf, args.cache_dir,
incpath = [os.path.join(topsrcdir, p) for p in args.incpath]
process(args.input_dirs, incpath, args.bindings_conf, args.cache_dir,
args.headerdir, args.xpcrsdir, args.xptdir, args.depsdir, args.module,
args.idls)

View File

@ -1052,9 +1052,11 @@ class RecursiveMakeBackend(CommonBackend):
xpt_modules = sorted(modules.keys())
mk = Makefile()
all_directories = set()
for module in xpt_modules:
sources, directories = modules[module]
all_directories |= directories
deps = sorted(sources)
directories = sorted(directories)
@ -1074,6 +1076,8 @@ class RecursiveMakeBackend(CommonBackend):
build_files.add_optional_exists('%s.xpt' % module)
mk.add_statement('all_idl_dirs = %s' % ' '.join(sorted(all_directories)))
rules = StringIO()
mk.dump(rules, removal_guard=False)

View File

@ -786,6 +786,9 @@ class TupBackend(CommonBackend):
backend_file = self._get_backend_file('xpcom/xpidl')
backend_file.export_shell()
all_idl_directories = set()
all_idl_directories.update(*map(lambda x: x[1], manager.modules.itervalues()))
all_xpts = []
for module, (idls, directories) in sorted(manager.modules.iteritems()):
cmd = [
@ -800,9 +803,10 @@ class TupBackend(CommonBackend):
for d in directories:
cmd.extend(['--input-dir', d])
for d in all_idl_directories:
cmd.extend(['-I', d])
cmd.extend([
'-I', '$(DIST)/idl',
'$(DIST)/include',
'$(DIST)/xpcrs',
'.',