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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 out, _ = popen.communicate() | 213 out, _ = popen.communicate() |
214 for line in out.splitlines(): | 214 for line in out.splitlines(): |
215 if line and 'manifest authoring warning 81010002' not in line: | 215 if line and 'manifest authoring warning 81010002' not in line: |
216 print line | 216 print line |
217 return popen.returncode | 217 return popen.returncode |
218 | 218 |
219 def ExecManifestToRc(self, arch, *args): | 219 def ExecManifestToRc(self, arch, *args): |
220 """Creates a resource file pointing a SxS assembly manifest. | 220 """Creates a resource file pointing a SxS assembly manifest. |
221 |args| is tuple containing path to resource file, path to manifest file | 221 |args| is tuple containing path to resource file, path to manifest file |
222 and resource name which can be "1" (for executables) or "2" (for DLLs).""" | 222 and resource name which can be "1" (for executables) or "2" (for DLLs).""" |
| 223 # pylint: disable=unbalanced-tuple-unpacking |
223 manifest_path, resource_path, resource_name = args | 224 manifest_path, resource_path, resource_name = args |
224 with open(resource_path, 'wb') as output: | 225 with open(resource_path, 'wb') as output: |
225 output.write('#include <windows.h>\n%s RT_MANIFEST "%s"' % ( | 226 output.write('#include <windows.h>\n%s RT_MANIFEST "%s"' % ( |
226 resource_name, | 227 resource_name, |
227 os.path.abspath(manifest_path).replace('\\', '/'))) | 228 os.path.abspath(manifest_path).replace('\\', '/'))) |
228 | 229 |
229 def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, | 230 def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, |
230 *flags): | 231 *flags): |
231 """Filter noisy filenames output from MIDL compile step that isn't | 232 """Filter noisy filenames output from MIDL compile step that isn't |
232 quietable via command line flags. | 233 quietable via command line flags. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 project_dir = os.path.relpath(project_dir, BASE_DIR) | 307 project_dir = os.path.relpath(project_dir, BASE_DIR) |
307 selected_files = selected_files.split(';') | 308 selected_files = selected_files.split(';') |
308 ninja_targets = [os.path.join(project_dir, filename) + '^^' | 309 ninja_targets = [os.path.join(project_dir, filename) + '^^' |
309 for filename in selected_files] | 310 for filename in selected_files] |
310 cmd = ['ninja.exe'] | 311 cmd = ['ninja.exe'] |
311 cmd.extend(ninja_targets) | 312 cmd.extend(ninja_targets) |
312 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) | 313 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) |
313 | 314 |
314 if __name__ == '__main__': | 315 if __name__ == '__main__': |
315 sys.exit(main(sys.argv[1:])) | 316 sys.exit(main(sys.argv[1:])) |
OLD | NEW |