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 | 5 import errno |
6 import os | 6 import os |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
11 """ | 11 # Copies the given "win tool" (which the toolchain uses to wrap compiler |
12 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 |
13 invocations) and the environment blocks for the 32-bit and 64-bit builds on | 13 # Windows to the build directory. |
14 Windows to the build directory. | 14 # |
15 | 15 # The arguments are the visual studio install location and the location of the |
16 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 |
17 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. |
18 and the files will be written to the current directory. | |
19 """ | |
20 | 18 |
21 | 19 |
22 def _ExtractImportantEnvironment(output_of_set): | 20 def _ExtractImportantEnvironment(output_of_set): |
23 """Extracts environment variables required for the toolchain to run from | 21 """Extracts environment variables required for the toolchain to run from |
24 a textual dump output by the cmd.exe 'set' command.""" | 22 a textual dump output by the cmd.exe 'set' command.""" |
25 envvars_to_save = ( | 23 envvars_to_save = ( |
26 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. | 24 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. |
27 'include', | 25 'include', |
28 'lib', | 26 'lib', |
29 'libpath', | 27 'libpath', |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 '# Generated by setup_toolchain.py do not edit.\n'] | 95 '# Generated by setup_toolchain.py do not edit.\n'] |
98 + tool_source[1:])) | 96 + tool_source[1:])) |
99 | 97 |
100 | 98 |
101 def main(): | 99 def main(): |
102 if len(sys.argv) != 6: | 100 if len(sys.argv) != 6: |
103 print('Usage setup_toolchain.py ' | 101 print('Usage setup_toolchain.py ' |
104 '<visual studio path> <win tool path> <win sdk path> ' | 102 '<visual studio path> <win tool path> <win sdk path> ' |
105 '<runtime dirs> <cpu_arch>') | 103 '<runtime dirs> <cpu_arch>') |
106 sys.exit(2) | 104 sys.exit(2) |
107 vs_path = sys.argv[1] | 105 dummy_vs_path = sys.argv[1] |
scottmg
2015/02/17 02:51:56
I think just delete this line is fine. Someone wil
Yoshisato Yanagisawa
2015/02/17 03:39:34
Done.
| |
108 tool_source = sys.argv[2] | 106 tool_source = sys.argv[2] |
109 win_sdk_path = sys.argv[3] | 107 win_sdk_path = sys.argv[3] |
110 runtime_dirs = sys.argv[4] | 108 runtime_dirs = sys.argv[4] |
111 cpu_arch = sys.argv[5] | 109 cpu_arch = sys.argv[5] |
112 | 110 |
113 _CopyTool(tool_source) | 111 _CopyTool(tool_source) |
114 | 112 |
115 archs = ('x86', 'x64') | 113 archs = ('x86', 'x64') |
116 assert cpu_arch in archs | 114 assert cpu_arch in archs |
117 vc_bin_dir = '' | 115 vc_bin_dir = '' |
(...skipping 30 matching lines...) Expand all Loading... | |
148 env_block = _FormatAsEnvironmentBlock(env) | 146 env_block = _FormatAsEnvironmentBlock(env) |
149 with open('environment.' + arch, 'wb') as f: | 147 with open('environment.' + arch, 'wb') as f: |
150 f.write(env_block) | 148 f.write(env_block) |
151 | 149 |
152 assert vc_bin_dir | 150 assert vc_bin_dir |
153 print 'vc_bin_dir = "%s"' % vc_bin_dir | 151 print 'vc_bin_dir = "%s"' % vc_bin_dir |
154 | 152 |
155 | 153 |
156 if __name__ == '__main__': | 154 if __name__ == '__main__': |
157 main() | 155 main() |
OLD | NEW |