Chromium Code Reviews| Index: build/vs_toolchain.py |
| diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py |
| index f6aef3aeab04a90b5b7bc072098c9eff0d7b61ee..abbdb132a33789e15fd28364ac07413586b3a4ee 100755 |
| --- a/build/vs_toolchain.py |
| +++ b/build/vs_toolchain.py |
| @@ -3,6 +3,7 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import glob |
| import json |
| import os |
| import pipes |
| @@ -151,14 +152,15 @@ def _VersionNumber(): |
| raise ValueError('Unexpected GYP_MSVS_VERSION') |
| -def _CopyRuntimeImpl(target, source): |
| +def _CopyRuntimeImpl(target, source, verbose = True): |
|
M-A Ruel
2016/02/08 20:19:14
verbose=True
brucedawson
2016/02/08 21:00:31
Done.
|
| """Copy |source| to |target| if it doesn't already exist or if it |
| needs 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 verbose: |
| + print 'Copying %s to %s...' % (source, target) |
| if os.path.exists(target): |
| os.unlink(target) |
| shutil.copy2(source, target) |
| @@ -190,9 +192,14 @@ def _CopyRuntime(target_dir, source_dir, target_cpu, debug): |
| suffix = "d.dll" if debug else ".dll" |
| if GetVisualStudioVersion() == '2015': |
| _CopyRuntime2015(target_dir, source_dir, '%s140' + suffix) |
| - if debug: |
| - _CopyRuntimeImpl(os.path.join(target_dir, 'ucrtbased.dll'), |
| - os.path.join(source_dir, 'ucrtbased.dll')) |
| + ucrt_src_dir = os.path.join(source_dir, "api-ms-win-*.dll") |
|
M-A Ruel
2016/02/08 20:19:14
single quote
brucedawson
2016/02/08 21:00:31
Done.
|
| + print 'Copying %s to %s...' % (ucrt_src_dir, target_dir) |
| + for ucrt_src_file in glob.glob(ucrt_src_dir): |
| + file_part = os.path.split(ucrt_src_file)[1] |
|
M-A Ruel
2016/02/08 20:19:14
os.path.basename()
brucedawson
2016/02/08 21:00:31
Much better. Done.
|
| + ucrt_dst_file = os.path.join(target_dir, file_part) |
| + _CopyRuntimeImpl(ucrt_dst_file, ucrt_src_file, verbose = False) |
|
M-A Ruel
2016/02/08 20:19:14
remove "verbose = "
brucedawson
2016/02/08 21:00:31
Done.
|
| + _CopyRuntimeImpl(os.path.join(target_dir, 'ucrtbase' + suffix), |
| + os.path.join(source_dir, 'ucrtbase' + suffix)) |
| else: |
| _CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix) |