Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import json | 6 import json |
| 7 import os | 7 import os |
| 8 import pipes | 8 import pipes |
| 9 import shutil | 9 import shutil |
| 10 import subprocess | 10 import subprocess |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 source = os.path.join(source_dir, dll) | 177 source = os.path.join(source_dir, dll) |
| 178 _CopyRuntimeImpl(target, source) | 178 _CopyRuntimeImpl(target, source) |
| 179 | 179 |
| 180 | 180 |
| 181 def _CopyRuntime(target_dir, source_dir, target_cpu, debug): | 181 def _CopyRuntime(target_dir, source_dir, target_cpu, debug): |
| 182 """Copy the VS runtime DLLs, only if the target doesn't exist, but the target | 182 """Copy the VS runtime DLLs, only if the target doesn't exist, but the target |
| 183 directory does exist. Handles VS 2013 and VS 2015.""" | 183 directory does exist. Handles VS 2013 and VS 2015.""" |
| 184 suffix = "d.dll" if debug else ".dll" | 184 suffix = "d.dll" if debug else ".dll" |
| 185 if GetVisualStudioVersion() == '2015': | 185 if GetVisualStudioVersion() == '2015': |
| 186 _CopyRuntime2015(target_dir, source_dir, '%s140' + suffix) | 186 _CopyRuntime2015(target_dir, source_dir, '%s140' + suffix) |
| 187 if debug: | |
| 188 _CopyRuntimeImpl(os.path.join(target_dir, 'ucrtbased.dll'), | |
| 189 os.path.join(source_dir, 'ucrtbased.dll')) | |
| 187 else: | 190 else: |
| 188 _CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix) | 191 _CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix) |
| 189 | 192 |
| 190 # Copy the PGO runtime library to the release directories. | 193 # Copy the PGO runtime library to the release directories. |
| 191 if not debug and os.environ.get('GYP_MSVS_OVERRIDE_PATH'): | 194 if not debug and os.environ.get('GYP_MSVS_OVERRIDE_PATH'): |
| 192 pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'), | 195 pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'), |
| 193 'VC', 'bin') | 196 'VC', 'bin') |
| 194 pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64') | 197 pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64') |
| 195 pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll' | 198 pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll' |
| 196 if target_cpu == "x86": | 199 if target_cpu == "x86": |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime | 258 runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime |
| 256 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=False) | 259 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=False) |
| 257 if configuration == 'Debug': | 260 if configuration == 'Debug': |
| 258 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True) | 261 _CopyRuntime(target_dir, runtime_dir, target_cpu, debug=True) |
| 259 | 262 |
| 260 | 263 |
| 261 def _GetDesiredVsToolchainHashes(): | 264 def _GetDesiredVsToolchainHashes(): |
| 262 """Load a list of SHA1s corresponding to the toolchains that we want installed | 265 """Load a list of SHA1s corresponding to the toolchains that we want installed |
| 263 to build with.""" | 266 to build with.""" |
| 264 if GetVisualStudioVersion() == '2015': | 267 if GetVisualStudioVersion() == '2015': |
| 265 return ['17c7ddb3595be5c6b9c98b6f930adad7e4456671'] # Update 1 | 268 return ['524956ec6e64e68fead3773e3ce318537657b404'] # Update 1 with Debugger s, UCRT installers and ucrtbased.dll |
|
scottmg
2016/01/15 19:19:45
80 col
| |
| 266 else: | 269 else: |
| 267 # Default to VS2013. | 270 # Default to VS2013. |
| 268 return ['9ff97c632ae1fee0c98bcd53e71770eb3a0d8deb'] | 271 return ['9ff97c632ae1fee0c98bcd53e71770eb3a0d8deb'] |
| 269 | 272 |
| 270 | 273 |
| 271 def Update(force=False): | 274 def Update(force=False): |
| 272 """Requests an update of the toolchain to the specific hashes we have at | 275 """Requests an update of the toolchain to the specific hashes we have at |
| 273 this revision. The update outputs a .json of the various configuration | 276 this revision. The update outputs a .json of the various configuration |
| 274 information required to pass to gyp which we use in |GetToolchainDir()|. | 277 information required to pass to gyp which we use in |GetToolchainDir()|. |
| 275 """ | 278 """ |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 'copy_dlls': CopyDlls, | 333 'copy_dlls': CopyDlls, |
| 331 } | 334 } |
| 332 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 335 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
| 333 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 336 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
| 334 return 1 | 337 return 1 |
| 335 return commands[sys.argv[1]](*sys.argv[2:]) | 338 return commands[sys.argv[1]](*sys.argv[2:]) |
| 336 | 339 |
| 337 | 340 |
| 338 if __name__ == '__main__': | 341 if __name__ == '__main__': |
| 339 sys.exit(main()) | 342 sys.exit(main()) |
| OLD | NEW |