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 """This script is used to download prebuilt clang binaries. | 6 """This script is used to download prebuilt clang binaries. |
7 | 7 |
8 It is also used by package.py to build the prebuilt clang binaries.""" | 8 It is also used by package.py to build the prebuilt clang binaries.""" |
9 | 9 |
10 import argparse | 10 import argparse |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 if args.if_needed: | 835 if args.if_needed: |
836 is_clang_required = False | 836 is_clang_required = False |
837 # clang is always used on Mac and Linux. | 837 # clang is always used on Mac and Linux. |
838 if sys.platform == 'darwin' or sys.platform.startswith('linux'): | 838 if sys.platform == 'darwin' or sys.platform.startswith('linux'): |
839 is_clang_required = True | 839 is_clang_required = True |
840 # clang requested via $GYP_DEFINES. | 840 # clang requested via $GYP_DEFINES. |
841 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1', | 841 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1', |
842 os.environ.get('GYP_DEFINES', '')): | 842 os.environ.get('GYP_DEFINES', '')): |
843 is_clang_required = True | 843 is_clang_required = True |
844 # clang previously downloaded, keep it up-to-date. | 844 # clang previously downloaded, keep it up to date. |
845 # If you don't want this, delete third_party/llvm-build on your machine. | 845 # If you don't want this, delete third_party/llvm-build on your machine. |
846 if os.path.isdir(LLVM_BUILD_DIR): | 846 if os.path.isdir(LLVM_BUILD_DIR): |
847 is_clang_required = True | 847 is_clang_required = True |
848 if not is_clang_required: | 848 if not is_clang_required: |
849 return 0 | 849 return 0 |
850 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 850 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
851 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 851 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
852 return 0 | 852 return 0 |
853 | 853 |
854 global CLANG_REVISION, PACKAGE_VERSION | 854 global CLANG_REVISION, PACKAGE_VERSION |
(...skipping 22 matching lines...) Expand all Loading... |
877 args.force_local_build = True | 877 args.force_local_build = True |
878 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 878 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
879 # Only build the Android ASan rt on ToT bots when targetting Android. | 879 # Only build the Android ASan rt on ToT bots when targetting Android. |
880 args.with_android = False | 880 args.with_android = False |
881 | 881 |
882 return UpdateClang(args) | 882 return UpdateClang(args) |
883 | 883 |
884 | 884 |
885 if __name__ == '__main__': | 885 if __name__ == '__main__': |
886 sys.exit(main()) | 886 sys.exit(main()) |
OLD | NEW |