| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl | 141 # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl |
| 142 # objidl.idl | 142 # objidl.idl |
| 143 lines = out.splitlines() | 143 lines = out.splitlines() |
| 144 prefix = 'Processing ' | 144 prefix = 'Processing ' |
| 145 processing = set(os.path.basename(x) for x in lines if x.startswith(prefix)) | 145 processing = set(os.path.basename(x) for x in lines if x.startswith(prefix)) |
| 146 for line in lines: | 146 for line in lines: |
| 147 if not line.startswith(prefix) and line not in processing: | 147 if not line.startswith(prefix) and line not in processing: |
| 148 print line | 148 print line |
| 149 return popen.returncode | 149 return popen.returncode |
| 150 | 150 |
| 151 def ExecAsmWrapper(self, arch, *args): | 151 def ExecAsmWrapper(self, arch, *flags): |
| 152 """Filter logo banner from invocations of asm.exe.""" | 152 """Filter logo banner from invocations of asm.exe.""" |
| 153 env = self._GetEnv(arch) | 153 env = self._GetEnv(arch) |
| 154 # MSVS doesn't assemble x64 asm files. | 154 if arch == 'environment.x86': |
| 155 if arch == 'environment.x64': | 155 args = ['ml', '/nologo'] + list(flags) |
| 156 elif arch == 'environment.x64': |
| 157 args = ['ml64', '/nologo'] + list(flags) |
| 158 else: |
| 156 return 0 | 159 return 0 |
| 157 popen = subprocess.Popen(args, shell=True, env=env, | 160 popen = subprocess.Popen(args, shell=True, env=env, |
| 158 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 161 stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
| 159 out, _ = popen.communicate() | 162 out, _ = popen.communicate() |
| 160 for line in out.splitlines(): | 163 for line in out.splitlines(): |
| 161 if (not line.startswith('Copyright (C) Microsoft Corporation') and | 164 if (not line.startswith('Copyright (C) Microsoft Corporation') and |
| 162 not line.startswith('Microsoft (R) Macro Assembler') and | 165 not line.startswith('Microsoft (R) Macro Assembler') and |
| 163 not line.startswith(' Assembling: ') and | 166 not line.startswith(' Assembling: ') and |
| 164 line): | 167 line): |
| 165 print line | 168 print line |
| (...skipping 18 matching lines...) Expand all Loading... |
| 184 for |arch|. If |dir| is supplied, use that as the working directory.""" | 187 for |arch|. If |dir| is supplied, use that as the working directory.""" |
| 185 env = self._GetEnv(arch) | 188 env = self._GetEnv(arch) |
| 186 args = open(rspfile).read() | 189 args = open(rspfile).read() |
| 187 dir = dir[0] if dir else None | 190 dir = dir[0] if dir else None |
| 188 popen = subprocess.Popen(args, shell=True, env=env, cwd=dir) | 191 popen = subprocess.Popen(args, shell=True, env=env, cwd=dir) |
| 189 popen.wait() | 192 popen.wait() |
| 190 return popen.returncode | 193 return popen.returncode |
| 191 | 194 |
| 192 if __name__ == '__main__': | 195 if __name__ == '__main__': |
| 193 sys.exit(main(sys.argv[1:])) | 196 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |