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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. | 143 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. |
144 # TODO(hans): Remove once the regular build above produces this. | 144 # TODO(hans): Remove once the regular build above produces this. |
145 if not os.path.exists(COMPILER_RT_BUILD_DIR): | 145 if not os.path.exists(COMPILER_RT_BUILD_DIR): |
146 os.makedirs(COMPILER_RT_BUILD_DIR) | 146 os.makedirs(COMPILER_RT_BUILD_DIR) |
147 os.chdir(COMPILER_RT_BUILD_DIR) | 147 os.chdir(COMPILER_RT_BUILD_DIR) |
148 RunCommand(GetVSVersion().SetupScript('x86') + | 148 RunCommand(GetVSVersion().SetupScript('x86') + |
149 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', | 149 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', |
150 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) | 150 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
151 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) | 151 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) |
152 | 152 |
153 # TODO(hans): Make this (and the .gypi file) version number independent. | 153 # TODO(hans): Make this (and the .gypi file) version number independent. |
Nico
2014/08/04 15:48:51
Maybe we can fix this todo before 3.7 rolls around
| |
154 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', | 154 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', |
155 '3.5.0', 'lib', 'windows') | 155 '3.6.0', 'lib', 'windows') |
156 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', | 156 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
157 '3.5.0', 'lib', 'windows') | 157 '3.6.0', 'lib', 'windows') |
158 | 158 |
159 if not os.path.exists(asan_rt_lib_dst_dir): | 159 if not os.path.exists(asan_rt_lib_dst_dir): |
160 os.makedirs(asan_rt_lib_dst_dir) | 160 os.makedirs(asan_rt_lib_dst_dir) |
161 for root, _, files in os.walk(asan_rt_lib_src_dir): | 161 for root, _, files in os.walk(asan_rt_lib_src_dir): |
162 for f in files: | 162 for f in files: |
163 if re.match(r'^.*-i386\.lib$', f): | 163 if re.match(r'^.*-i386\.lib$', f): |
164 CopyFile(os.path.join(root, f), asan_rt_lib_dst_dir) | 164 CopyFile(os.path.join(root, f), asan_rt_lib_dst_dir) |
165 | 165 |
166 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), | 166 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), |
167 os.path.join(asan_rt_lib_dst_dir, '..', '..')) | 167 os.path.join(asan_rt_lib_dst_dir, '..', '..')) |
168 | 168 |
169 # Make an extra copy of the sanitizer headers, to be put on the include path | 169 # Make an extra copy of the sanitizer headers, to be put on the include path |
170 # of the fallback compiler. | 170 # of the fallback compiler. |
171 sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '3.5.0', | 171 sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '3.6.0', |
172 'include', 'sanitizer') | 172 'include', 'sanitizer') |
173 aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', | 173 aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
174 '3.5.0', 'include_sanitizer', | 174 '3.6.0', 'include_sanitizer', |
175 'sanitizer') | 175 'sanitizer') |
176 if not os.path.exists(aux_sanitizer_include_dir): | 176 if not os.path.exists(aux_sanitizer_include_dir): |
177 os.makedirs(aux_sanitizer_include_dir) | 177 os.makedirs(aux_sanitizer_include_dir) |
178 for _, _, files in os.walk(sanitizer_include_dir): | 178 for _, _, files in os.walk(sanitizer_include_dir): |
179 for f in files: | 179 for f in files: |
180 CopyFile(os.path.join(sanitizer_include_dir, f), | 180 CopyFile(os.path.join(sanitizer_include_dir, f), |
181 aux_sanitizer_include_dir) | 181 aux_sanitizer_include_dir) |
182 | 182 |
183 WriteStampFile(LLVM_WIN_REVISION) | 183 WriteStampFile(LLVM_WIN_REVISION) |
184 print 'Clang update was successful.' | 184 print 'Clang update was successful.' |
(...skipping 24 matching lines...) Expand all Loading... | |
209 | 209 |
210 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 210 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
211 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 211 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
212 return 0 | 212 return 0 |
213 | 213 |
214 return UpdateClang() | 214 return UpdateClang() |
215 | 215 |
216 | 216 |
217 if __name__ == '__main__': | 217 if __name__ == '__main__': |
218 sys.exit(main()) | 218 sys.exit(main()) |
OLD | NEW |