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