Chromium Code Reviews| Index: build/vs_toolchain.py |
| diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py |
| index 558ad3abeabe7bf3c1a7235c56a90cb27709a766..0357f7a6d22fe78757511551f9b2965aa8a368a9 100644 |
| --- a/build/vs_toolchain.py |
| +++ b/build/vs_toolchain.py |
| @@ -71,6 +71,18 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs): |
| """ |
| assert sys.platform.startswith(('win32', 'cygwin')) |
| + def copy_runtime_impl(target, source): |
| + """Copy |source| to |target| if it doesn't already exist or if it need to be |
| + updated. |
| + """ |
| + if (os.path.isdir(os.path.dirname(target)) and |
| + (not os.path.isfile(target) or |
| + os.stat(target).st_mtime != os.stat(source).st_mtime)): |
| + print 'Copying %s to %s...' % (source, target) |
| + if os.path.exists(target): |
| + os.unlink(target) |
| + shutil.copy2(source, target) |
| + |
| def copy_runtime(target_dir, source_dir, dll_pattern): |
| """Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't |
| exist, but the target directory does exist.""" |
| @@ -78,15 +90,7 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs): |
| dll = dll_pattern % which |
| target = os.path.join(target_dir, dll) |
| source = os.path.join(source_dir, dll) |
| - # If gyp generated to that output dir, and the runtime isn't already |
| - # there, then copy it over. |
| - if (os.path.isdir(target_dir) and |
| - (not os.path.isfile(target) or |
| - os.stat(target).st_mtime != os.stat(source).st_mtime)): |
| - print 'Copying %s to %s...' % (source, target) |
| - if os.path.exists(target): |
| - os.unlink(target) |
| - shutil.copy2(source, target) |
| + copy_runtime_impl(target, source) |
| x86, x64 = runtime_dirs |
| out_debug = os.path.join(output_dir, 'Debug') |
| @@ -107,6 +111,14 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs): |
| copy_runtime(out_debug_nacl64, x64, 'msvc%s120d.dll') |
| copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') |
| + # Copy the PGO runtime library to the release directory. |
| + if os.environ.get('GYP_MSVS_OVERRIDE_PATH'): |
|
scottmg
2014/07/18 19:23:13
hm, it'd be nicer to pass the source directory in,
Sébastien Marchand
2014/07/18 20:18:52
Yeah, I wanted to make sure that I didn't break an
|
| + pgo_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'), |
| + 'VC', 'bin') |
| + pgo_runtime_dll = 'pgort120.dll' |
|
scottmg
2014/07/18 19:23:13
we need to copy the amd64\pgort120.dll to release_
Sébastien Marchand
2014/07/18 20:18:52
Yeah I think so, I haven't really worked on the x6
|
| + target = os.path.join(out_release, pgo_runtime_dll) |
| + copy_runtime_impl(target, os.path.join(pgo_runtime_dir, pgo_runtime_dll)) |
| + |
| def _GetDesiredVsToolchainHashes(): |
| """Load a list of SHA1s corresponding to the toolchains that we want installed |