OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 json | 5 import json |
6 import os | 6 import os |
7 import pipes | 7 import pipes |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 '--output-json', json_data_file, | 177 '--output-json', json_data_file, |
178 ] + _GetDesiredVsToolchainHashes() | 178 ] + _GetDesiredVsToolchainHashes() |
179 subprocess.check_call(get_toolchain_args) | 179 subprocess.check_call(get_toolchain_args) |
180 | 180 |
181 return 0 | 181 return 0 |
182 | 182 |
183 | 183 |
184 def GetToolchainDir(): | 184 def GetToolchainDir(): |
185 """Gets location information about the current toolchain (must have been | 185 """Gets location information about the current toolchain (must have been |
186 previously updated by 'update'). This is used for the GN build.""" | 186 previously updated by 'update'). This is used for the GN build.""" |
187 SetEnvironmentAndGetRuntimeDllDirs() | 187 runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() |
188 | 188 |
189 # If WINDOWSSDKDIR is not set, search the default SDK path and set it. | 189 # If WINDOWSSDKDIR is not set, search the default SDK path and set it. |
190 if not 'WINDOWSSDKDIR' in os.environ: | 190 if not 'WINDOWSSDKDIR' in os.environ: |
191 default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\8.0' | 191 default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\8.1' |
192 if os.path.isdir(default_sdk_path): | 192 if os.path.isdir(default_sdk_path): |
193 os.environ['WINDOWSSDKDIR'] = default_sdk_path | 193 os.environ['WINDOWSSDKDIR'] = default_sdk_path |
194 | 194 |
195 print '''vs_path = "%s" | 195 print '''vs_path = "%s" |
196 sdk_path = "%s" | 196 sdk_path = "%s" |
197 vs_version = "%s" | 197 vs_version = "%s" |
198 wdk_dir = "%s" | 198 wdk_dir = "%s" |
| 199 runtime_dirs = "%s" |
199 ''' % ( | 200 ''' % ( |
200 os.environ['GYP_MSVS_OVERRIDE_PATH'], | 201 os.environ['GYP_MSVS_OVERRIDE_PATH'], |
201 os.environ['WINDOWSSDKDIR'], | 202 os.environ['WINDOWSSDKDIR'], |
202 os.environ['GYP_MSVS_VERSION'], | 203 os.environ['GYP_MSVS_VERSION'], |
203 os.environ.get('WDK_DIR', '')) | 204 os.environ.get('WDK_DIR', ''), |
| 205 ';'.join(runtime_dll_dirs)) |
204 | 206 |
205 | 207 |
206 def main(): | 208 def main(): |
207 if not sys.platform.startswith(('win32', 'cygwin')): | 209 if not sys.platform.startswith(('win32', 'cygwin')): |
208 return 0 | 210 return 0 |
209 commands = { | 211 commands = { |
210 'update': Update, | 212 'update': Update, |
211 'get_toolchain_dir': GetToolchainDir, | 213 'get_toolchain_dir': GetToolchainDir, |
212 'copy_dlls': CopyDlls, | 214 'copy_dlls': CopyDlls, |
213 } | 215 } |
214 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 216 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
215 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 217 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
216 return 1 | 218 return 1 |
217 return commands[sys.argv[1]](*sys.argv[2:]) | 219 return commands[sys.argv[1]](*sys.argv[2:]) |
218 | 220 |
219 | 221 |
220 if __name__ == '__main__': | 222 if __name__ == '__main__': |
221 sys.exit(main()) | 223 sys.exit(main()) |
OLD | NEW |