| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 # |
| 5 import errno | |
| 6 import os | |
| 7 import re | |
| 8 import subprocess | |
| 9 import sys | |
| 10 | |
| 11 # Copies the given "win tool" (which the toolchain uses to wrap compiler | 5 # Copies the given "win tool" (which the toolchain uses to wrap compiler |
| 12 # invocations) and the environment blocks for the 32-bit and 64-bit builds on | 6 # invocations) and the environment blocks for the 32-bit and 64-bit builds on |
| 13 # Windows to the build directory. | 7 # Windows to the build directory. |
| 14 # | 8 # |
| 15 # The arguments are the visual studio install location and the location of the | 9 # The arguments are the visual studio install location and the location of the |
| 16 # win tool. The script assumes that the root build directory is the current dir | 10 # win tool. The script assumes that the root build directory is the current dir |
| 17 # and the files will be written to the current directory. | 11 # and the files will be written to the current directory. |
| 18 | 12 |
| 13 import errno |
| 14 import os |
| 15 import re |
| 16 import subprocess |
| 17 import sys |
| 18 |
| 19 | 19 |
| 20 def _ExtractImportantEnvironment(output_of_set): | 20 def _ExtractImportantEnvironment(output_of_set): |
| 21 """Extracts environment variables required for the toolchain to run from | 21 """Extracts environment variables required for the toolchain to run from |
| 22 a textual dump output by the cmd.exe 'set' command.""" | 22 a textual dump output by the cmd.exe 'set' command.""" |
| 23 envvars_to_save = ( | 23 envvars_to_save = ( |
| 24 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. | 24 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. |
| 25 'include', | 25 'include', |
| 26 'lib', | 26 'lib', |
| 27 'libpath', | 27 'libpath', |
| 28 'path', | 28 'path', |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 env_block = _FormatAsEnvironmentBlock(env) | 145 env_block = _FormatAsEnvironmentBlock(env) |
| 146 with open('environment.' + arch, 'wb') as f: | 146 with open('environment.' + arch, 'wb') as f: |
| 147 f.write(env_block) | 147 f.write(env_block) |
| 148 | 148 |
| 149 assert vc_bin_dir | 149 assert vc_bin_dir |
| 150 print 'vc_bin_dir = "%s"' % vc_bin_dir | 150 print 'vc_bin_dir = "%s"' % vc_bin_dir |
| 151 | 151 |
| 152 | 152 |
| 153 if __name__ == '__main__': | 153 if __name__ == '__main__': |
| 154 main() | 154 main() |
| OLD | NEW |