Index: tools/clang/scripts/update.py |
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py |
index 033aca1826e4006f3f6d6c9cac61525d8e7a6ee1..6aaf1458f3815304fd963bce71617d42ca15acb6 100755 |
--- a/tools/clang/scripts/update.py |
+++ b/tools/clang/scripts/update.py |
@@ -132,6 +132,16 @@ def GetVSVersion(): |
return vs_version |
+def CopyDirectoryContents(src, dst, filename_filter=None): |
hans
2014/08/29 16:31:06
Maybe define this with CopyFile above, and give it
|
+ if not os.path.exists(dst): |
+ os.makedirs(dst) |
+ for root, _, files in os.walk(src): |
+ for f in files: |
+ if filename_filter and not re.match(filename_filter, f): |
+ continue |
+ CopyFile(os.path.join(root, f), dst) |
+ |
+ |
def UpdateClang(): |
print 'Updating Clang to %s...' % (LLVM_WIN_REVISION) |
if LLVM_WIN_REVISION != 'HEAD' and ReadStampFile() == LLVM_WIN_REVISION: |
@@ -167,18 +177,18 @@ def UpdateClang(): |
'-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) |
+ asan_rt_bin_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'bin') |
+ asan_rt_bin_dst_dir = os.path.join(LLVM_BUILD_DIR, 'bin') |
+ CopyDirectoryContents(asan_rt_bin_src_dir, asan_rt_bin_dst_dir, |
+ r'^.*-i386\.dll$') |
+ |
# TODO(hans): Make this (and the .gypi file) version number independent. |
asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', |
'3.6.0', 'lib', 'windows') |
asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
'3.6.0', 'lib', 'windows') |
- |
- if not os.path.exists(asan_rt_lib_dst_dir): |
- os.makedirs(asan_rt_lib_dst_dir) |
- for root, _, files in os.walk(asan_rt_lib_src_dir): |
- for f in files: |
- if re.match(r'^.*-i386\.lib$', f): |
- CopyFile(os.path.join(root, f), asan_rt_lib_dst_dir) |
+ CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, |
+ r'^.*-i386\.lib$') |
CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), |
os.path.join(asan_rt_lib_dst_dir, '..', '..')) |