| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 pgo_runtime_dll = 'pgort120.dll' | 122 pgo_runtime_dll = 'pgort120.dll' |
| 123 source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll) | 123 source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll) |
| 124 if os.path.exists(source_x86): | 124 if os.path.exists(source_x86): |
| 125 _CopyRuntimeImpl(os.path.join(out_release, pgo_runtime_dll), source_x86) | 125 _CopyRuntimeImpl(os.path.join(out_release, pgo_runtime_dll), source_x86) |
| 126 source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll) | 126 source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll) |
| 127 if os.path.exists(source_x64): | 127 if os.path.exists(source_x64): |
| 128 _CopyRuntimeImpl(os.path.join(out_release_x64, pgo_runtime_dll), | 128 _CopyRuntimeImpl(os.path.join(out_release_x64, pgo_runtime_dll), |
| 129 source_x64) | 129 source_x64) |
| 130 | 130 |
| 131 | 131 |
| 132 def CopyDlls(target_dir, configuration, cpu_arch): | 132 def CopyDlls(target_dir, configuration, target_cpu): |
| 133 """Copy the VS runtime DLLs into the requested directory as needed. | 133 """Copy the VS runtime DLLs into the requested directory as needed. |
| 134 | 134 |
| 135 configuration is one of 'Debug' or 'Release'. | 135 configuration is one of 'Debug' or 'Release'. |
| 136 cpu_arch is one of 'x86' or 'x64'. | 136 target_cpu is one of 'x86' or 'x64'. |
| 137 | 137 |
| 138 The debug configuration gets both the debug and release DLLs; the | 138 The debug configuration gets both the debug and release DLLs; the |
| 139 release config only the latter. | 139 release config only the latter. |
| 140 """ | 140 """ |
| 141 vs2013_runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() | 141 vs2013_runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() |
| 142 if not vs2013_runtime_dll_dirs: | 142 if not vs2013_runtime_dll_dirs: |
| 143 return | 143 return |
| 144 | 144 |
| 145 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 145 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
| 146 runtime_dir = x64_runtime if cpu_arch == 'x64' else x86_runtime | 146 runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime |
| 147 _CopyRuntime(target_dir, runtime_dir, 'msvc%s120.dll') | 147 _CopyRuntime(target_dir, runtime_dir, 'msvc%s120.dll') |
| 148 if configuration == 'Debug': | 148 if configuration == 'Debug': |
| 149 _CopyRuntime(target_dir, runtime_dir, 'msvc%s120d.dll') | 149 _CopyRuntime(target_dir, runtime_dir, 'msvc%s120d.dll') |
| 150 | 150 |
| 151 | 151 |
| 152 def _GetDesiredVsToolchainHashes(): | 152 def _GetDesiredVsToolchainHashes(): |
| 153 """Load a list of SHA1s corresponding to the toolchains that we want installed | 153 """Load a list of SHA1s corresponding to the toolchains that we want installed |
| 154 to build with.""" | 154 to build with.""" |
| 155 sha1path = os.path.join(script_dir, 'toolchain_vs2013.hash') | 155 sha1path = os.path.join(script_dir, 'toolchain_vs2013.hash') |
| 156 with open(sha1path, 'rb') as f: | 156 with open(sha1path, 'rb') as f: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 'copy_dlls': CopyDlls, | 212 'copy_dlls': CopyDlls, |
| 213 } | 213 } |
| 214 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 214 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
| 215 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 215 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
| 216 return 1 | 216 return 1 |
| 217 return commands[sys.argv[1]](*sys.argv[2:]) | 217 return commands[sys.argv[1]](*sys.argv[2:]) |
| 218 | 218 |
| 219 | 219 |
| 220 if __name__ == '__main__': | 220 if __name__ == '__main__': |
| 221 sys.exit(main()) | 221 sys.exit(main()) |
| OLD | NEW |