Bug 1304136 - Use a single AccEventGen.py invocation; r?chmanchester
MozReview-Commit-ID: 84OjUxxK1lg
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -214,15 +214,15 @@ def write_cpp(eventname, iface, fd):
def get_conf(conf_file):
conf = Configuration(conf_file)
inc_dir = [
mozpath.join(buildconfig.topsrcdir, 'accessible', 'interfaces'),
mozpath.join(buildconfig.topsrcdir, 'xpcom', 'base'),
]
return conf, inc_dir
-def gen_header_file(fd, conf_file, xpidllex, xpidlyacc):
+def gen_files(fd, conf_file, xpidllex, xpidlyacc):
+ deps = set()
conf, inc_dir = get_conf(conf_file)
- return print_header_file(fd, conf, inc_dir)
-
-def gen_cpp_file(fd, conf_file, xpidllex, xpidlyacc):
- conf, inc_dir = get_conf(conf_file)
- return print_cpp_file(fd, conf, inc_dir)
+ deps.update(print_header_file(fd, conf, inc_dir))
+ with open('xpcAccEvents.cpp', 'w') as cpp_fd:
+ deps.update(print_cpp_file(cpp_fd, conf, inc_dir))
+ return deps
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -47,27 +47,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
LOCAL_INCLUDES += [
'/accessible/mac',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',
]
-GENERATED_FILES += [
- 'xpcAccEvents.cpp',
- 'xpcAccEvents.h',
-]
+GENERATED_FILES += [('xpcAccEvents.h', 'xpcAccEvents.cpp')]
-xpc_acc_events_h = GENERATED_FILES['xpcAccEvents.h']
-xpc_acc_events_h.script = 'AccEventGen.py:gen_header_file'
-xpc_acc_events_h.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
-
-xpc_acc_events_cpp = GENERATED_FILES['xpcAccEvents.cpp']
-xpc_acc_events_cpp.script = 'AccEventGen.py:gen_cpp_file'
-xpc_acc_events_cpp.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
+xpc_acc = GENERATED_FILES[('xpcAccEvents.h', 'xpcAccEvents.cpp')]
+xpc_acc.script = 'AccEventGen.py:gen_files'
+xpc_acc.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
FINAL_LIBRARY = 'xul'
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']