| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 os.chdir(COMPILER_RT_BUILD_DIR) | 645 os.chdir(COMPILER_RT_BUILD_DIR) |
| 646 # TODO(thakis): Add this once compiler-rt can build with clang-cl (see | 646 # TODO(thakis): Add this once compiler-rt can build with clang-cl (see |
| 647 # above). | 647 # above). |
| 648 #if args.bootstrap and sys.platform == 'win32': | 648 #if args.bootstrap and sys.platform == 'win32': |
| 649 # The bootstrap compiler produces 64-bit binaries by default. | 649 # The bootstrap compiler produces 64-bit binaries by default. |
| 650 #cflags += ['-m32'] | 650 #cflags += ['-m32'] |
| 651 #cxxflags += ['-m32'] | 651 #cxxflags += ['-m32'] |
| 652 compiler_rt_args = base_cmake_args + [ | 652 compiler_rt_args = base_cmake_args + [ |
| 653 '-DCMAKE_C_FLAGS=' + ' '.join(cflags), | 653 '-DCMAKE_C_FLAGS=' + ' '.join(cflags), |
| 654 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)] | 654 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)] |
| 655 if sys.platform == 'darwin': | |
| 656 compiler_rt_args += ['-DCOMPILER_RT_ENABLE_IOS=ON'] | |
| 657 if sys.platform != 'win32': | 655 if sys.platform != 'win32': |
| 658 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' + | 656 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' + |
| 659 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'), | 657 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'), |
| 660 '-DSANITIZER_MIN_OSX_VERSION="10.7"'] | 658 '-DSANITIZER_MIN_OSX_VERSION="10.7"'] |
| 661 # compiler-rt is part of the llvm checkout on Windows but a stand-alone | 659 # compiler-rt is part of the llvm checkout on Windows but a stand-alone |
| 662 # directory elsewhere, see the TODO above COMPILER_RT_DIR. | 660 # directory elsewhere, see the TODO above COMPILER_RT_DIR. |
| 663 RmCmakeCache('.') | 661 RmCmakeCache('.') |
| 664 RunCommand(['cmake'] + compiler_rt_args + | 662 RunCommand(['cmake'] + compiler_rt_args + |
| 665 [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR], | 663 [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR], |
| 666 msvc_arch='x86', env=deployment_env) | 664 msvc_arch='x86', env=deployment_env) |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 args.force_local_build = True | 861 args.force_local_build = True |
| 864 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 862 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
| 865 # Only build the Android ASan rt on ToT bots when targetting Android. | 863 # Only build the Android ASan rt on ToT bots when targetting Android. |
| 866 args.with_android = False | 864 args.with_android = False |
| 867 | 865 |
| 868 return UpdateClang(args) | 866 return UpdateClang(args) |
| 869 | 867 |
| 870 | 868 |
| 871 if __name__ == '__main__': | 869 if __name__ == '__main__': |
| 872 sys.exit(main()) | 870 sys.exit(main()) |
| OLD | NEW |