OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Windows can't run .sh files, so this is a Python implementation of | 6 """Windows can't run .sh files, so this is a Python implementation of |
7 update.sh. This script should replace update.sh on all platforms eventually.""" | 7 update.sh. This script should replace update.sh on all platforms eventually.""" |
8 | 8 |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. | 210 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. |
211 # TODO(hans): Remove once the regular build above produces this. | 211 # TODO(hans): Remove once the regular build above produces this. |
212 if not os.path.exists(COMPILER_RT_BUILD_DIR): | 212 if not os.path.exists(COMPILER_RT_BUILD_DIR): |
213 os.makedirs(COMPILER_RT_BUILD_DIR) | 213 os.makedirs(COMPILER_RT_BUILD_DIR) |
214 os.chdir(COMPILER_RT_BUILD_DIR) | 214 os.chdir(COMPILER_RT_BUILD_DIR) |
215 RunCommand(GetVSVersion().SetupScript('x86') + | 215 RunCommand(GetVSVersion().SetupScript('x86') + |
216 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', | 216 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', |
217 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) | 217 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
218 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) | 218 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) |
219 | 219 |
220 # TODO(hans): Make this (and the .gypi and .isolate file) version number | 220 # TODO(hans): Make this (and the .gypi and .isolate files) version number |
221 # independent. | 221 # independent. |
222 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', | 222 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', |
223 VERSION, 'lib', 'windows') | 223 VERSION, 'lib', 'windows') |
224 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', | 224 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
225 VERSION, 'lib', 'windows') | 225 VERSION, 'lib', 'windows') |
226 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, | 226 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, |
227 r'^.*-i386\.lib$') | 227 r'^.*-i386\.lib$') |
228 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, | 228 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, |
229 r'^.*-i386\.dll$') | 229 r'^.*-i386\.dll$') |
230 | 230 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 275 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
276 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 276 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
277 return 0 | 277 return 0 |
278 | 278 |
279 return UpdateClang() | 279 return UpdateClang() |
280 | 280 |
281 | 281 |
282 if __name__ == '__main__': | 282 if __name__ == '__main__': |
283 sys.exit(main()) | 283 sys.exit(main()) |
OLD | NEW |