| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 processing = set(os.path.basename(x) | 252 processing = set(os.path.basename(x) |
| 253 for x in lines if x.startswith(prefixes)) | 253 for x in lines if x.startswith(prefixes)) |
| 254 for line in lines: | 254 for line in lines: |
| 255 if not line.startswith(prefixes) and line not in processing: | 255 if not line.startswith(prefixes) and line not in processing: |
| 256 print line | 256 print line |
| 257 return popen.returncode | 257 return popen.returncode |
| 258 | 258 |
| 259 def ExecAsmWrapper(self, arch, *args): | 259 def ExecAsmWrapper(self, arch, *args): |
| 260 """Filter logo banner from invocations of asm.exe.""" | 260 """Filter logo banner from invocations of asm.exe.""" |
| 261 env = self._GetEnv(arch) | 261 env = self._GetEnv(arch) |
| 262 # MSVS doesn't assemble x64 asm files. | |
| 263 if arch == 'environment.x64': | |
| 264 return 0 | |
| 265 popen = subprocess.Popen(args, shell=True, env=env, | 262 popen = subprocess.Popen(args, shell=True, env=env, |
| 266 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 263 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 267 out, _ = popen.communicate() | 264 out, _ = popen.communicate() |
| 268 for line in out.splitlines(): | 265 for line in out.splitlines(): |
| 269 if (not line.startswith('Copyright (C) Microsoft Corporation') and | 266 if (not line.startswith('Copyright (C) Microsoft Corporation') and |
| 270 not line.startswith('Microsoft (R) Macro Assembler') and | 267 not line.startswith('Microsoft (R) Macro Assembler') and |
| 271 not line.startswith(' Assembling: ') and | 268 not line.startswith(' Assembling: ') and |
| 272 line): | 269 line): |
| 273 print line | 270 print line |
| 274 return popen.returncode | 271 return popen.returncode |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 project_dir = os.path.relpath(project_dir, BASE_DIR) | 303 project_dir = os.path.relpath(project_dir, BASE_DIR) |
| 307 selected_files = selected_files.split(';') | 304 selected_files = selected_files.split(';') |
| 308 ninja_targets = [os.path.join(project_dir, filename) + '^^' | 305 ninja_targets = [os.path.join(project_dir, filename) + '^^' |
| 309 for filename in selected_files] | 306 for filename in selected_files] |
| 310 cmd = ['ninja.exe'] | 307 cmd = ['ninja.exe'] |
| 311 cmd.extend(ninja_targets) | 308 cmd.extend(ninja_targets) |
| 312 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) | 309 return subprocess.call(cmd, shell=True, cwd=BASE_DIR) |
| 313 | 310 |
| 314 if __name__ == '__main__': | 311 if __name__ == '__main__': |
| 315 sys.exit(main(sys.argv[1:])) | 312 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |