Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1646)

Unified Diff: pylib/gyp/win_tool.py

Issue 9990006: ninja windows: Support magic idl build rules (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: macro expansion Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pylib/gyp/win_tool.py
diff --git a/pylib/gyp/win_tool.py b/pylib/gyp/win_tool.py
index 331a655957c8dd71091366cf923f7a0b91441535..d4afc1ea16a171867be504a86bd83fcf190cd257 100644
--- a/pylib/gyp/win_tool.py
+++ b/pylib/gyp/win_tool.py
@@ -64,5 +64,34 @@ class WinTool(object):
sys.stdout.write(line)
return popen.returncode
+ def ExecMidlWrapper(self, outdir, tlb, h, dlldata, iid, proxy, idl, *flags):
+ """Filter noisy filenames output from MIDL compile step that isn't
+ quietable via command line flags.
+ """
+ args = ['midl', '/nologo'] + list(flags) + [
+ '/out', outdir,
+ '/tlb', tlb,
+ '/h', h,
+ '/dlldata', dlldata,
+ '/iid', iid,
+ '/proxy', proxy,
+ idl]
+ popen = subprocess.Popen(args,
Nico 2012/04/05 04:37:11 nit: if you break after (, the rest might all fit
scottmg 2012/04/05 17:52:42 Done. (and above)
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ out, _ = popen.communicate()
+ # Filter junk out of stdout, and write filtered versions. Output we want
+ # to filter is pairs of lines that look like this:
+ # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl
+ # objidl.idl
+ lines = out.splitlines()
+ prefix = 'Processing '
+ processings = [os.path.basename(x) for x in lines if x.startswith(prefix)]
Nico 2012/04/05 04:37:11 :-D Do wrap this in a set(), just in case the out
scottmg 2012/04/05 17:52:42 Done.
+ for line in lines:
+ if not line.startswith(prefix) and x not in processings:
+ sys.stdout.write(line)
+ return popen.returncode
+
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

Powered by Google App Engine
This is Rietveld 408576698