Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2615)

Unified Diff: build/vs_toolchain.py

Issue 1676943002: Copy the Universal CRT files to the output dirs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR changes and CRLF to LF fixes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/vs_toolchain.py
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index f6aef3aeab04a90b5b7bc072098c9eff0d7b61ee..6ed55997ff118176f157ebf0a57912dd2f26b54f 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):
"""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')
+ print 'Copying %s to %s...' % (ucrt_src_dir, target_dir)
+ for ucrt_src_file in glob.glob(ucrt_src_dir):
+ file_part = os.path.basename(ucrt_src_file)
+ ucrt_dst_file = os.path.join(target_dir, file_part)
+ _CopyRuntimeImpl(ucrt_dst_file, ucrt_src_file, False)
+ _CopyRuntimeImpl(os.path.join(target_dir, 'ucrtbase' + suffix),
+ os.path.join(source_dir, 'ucrtbase' + suffix))
Nico 2016/02/09 01:13:38 shouldn't this blob be in _CopyRuntime2015() (sinc
brucedawson 2016/02/09 01:38:56 Yes, you're right. Of course, in a few weeks this
else:
_CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix)
« build/config/win/msvs_dependencies.isolate ('K') | « build/config/win/msvs_dependencies.isolate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698