OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Utility functions for Windows builds. | 7 """Utility functions for Windows builds. |
8 | 8 |
9 These functions are executed via gyp-win-tool when using the ninja generator. | 9 These functions are executed via gyp-win-tool when using the ninja generator. |
10 """ | 10 """ |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 if line and 'manifest authoring warning 81010002' not in line: | 91 if line and 'manifest authoring warning 81010002' not in line: |
92 print line | 92 print line |
93 return popen.returncode | 93 return popen.returncode |
94 | 94 |
95 def ExecManifestToRc(self, arch, *args): | 95 def ExecManifestToRc(self, arch, *args): |
96 """Creates a resource file pointing a SxS assembly manifest. | 96 """Creates a resource file pointing a SxS assembly manifest. |
97 |args| is tuple containing path to resource file, path to manifest file | 97 |args| is tuple containing path to resource file, path to manifest file |
98 and resource name which can be "1" (for executables) or "2" (for DLLs).""" | 98 and resource name which can be "1" (for executables) or "2" (for DLLs).""" |
99 manifest_path, resource_path, resource_name = args | 99 manifest_path, resource_path, resource_name = args |
100 with open(resource_path, 'wb') as output: | 100 with open(resource_path, 'wb') as output: |
101 output.write('#include <winuser.h>\n%s RT_MANIFEST "%s"' % ( | 101 output.write('#include <windows.h>\n%s RT_MANIFEST "%s"' % ( |
102 resource_name, | 102 resource_name, |
103 os.path.abspath(manifest_path).replace('\\', '/'))) | 103 os.path.abspath(manifest_path).replace('\\', '/'))) |
104 | 104 |
105 def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, | 105 def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, |
106 *flags): | 106 *flags): |
107 """Filter noisy filenames output from MIDL compile step that isn't | 107 """Filter noisy filenames output from MIDL compile step that isn't |
108 quietable via command line flags. | 108 quietable via command line flags. |
109 """ | 109 """ |
110 args = ['midl', '/nologo'] + list(flags) + [ | 110 args = ['midl', '/nologo'] + list(flags) + [ |
111 '/out', outdir, | 111 '/out', outdir, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 for |arch|. If |dir| is supplied, use that as the working directory.""" | 167 for |arch|. If |dir| is supplied, use that as the working directory.""" |
168 env = self._GetEnv(arch) | 168 env = self._GetEnv(arch) |
169 args = open(rspfile).read() | 169 args = open(rspfile).read() |
170 dir = dir[0] if dir else None | 170 dir = dir[0] if dir else None |
171 popen = subprocess.Popen(args, shell=True, env=env, cwd=dir) | 171 popen = subprocess.Popen(args, shell=True, env=env, cwd=dir) |
172 popen.wait() | 172 popen.wait() |
173 return popen.returncode | 173 return popen.returncode |
174 | 174 |
175 if __name__ == '__main__': | 175 if __name__ == '__main__': |
176 sys.exit(main(sys.argv[1:])) | 176 sys.exit(main(sys.argv[1:])) |
OLD | NEW |