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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 RmTree(LIBCXX_DIR) | 612 RmTree(LIBCXX_DIR) |
613 | 613 |
614 # Build clang. | 614 # Build clang. |
615 | 615 |
616 # If building at head, define a macro that plugins can use for #ifdefing | 616 # If building at head, define a macro that plugins can use for #ifdefing |
617 # out code that builds at head, but not at CLANG_REVISION or vice versa. | 617 # out code that builds at head, but not at CLANG_REVISION or vice versa. |
618 if use_head_revision: | 618 if use_head_revision: |
619 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 619 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
620 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 620 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
621 | 621 |
| 622 # Build PDBs for archival on Windows. Don't use RelWithDebInfo since it |
| 623 # has different optimization defaults than Release. |
| 624 if sys.platform == 'win32' and args.bootstrap: |
| 625 cflags += ['/Zi'] |
| 626 cxxflags += ['/Zi'] |
| 627 ldflags += ['/DEBUG', '/OPT:REF', '/OPT:ICF'] |
| 628 |
622 CreateChromeToolsShim() | 629 CreateChromeToolsShim() |
623 | 630 |
624 deployment_env = None | 631 deployment_env = None |
625 if deployment_target: | 632 if deployment_target: |
626 deployment_env = os.environ.copy() | 633 deployment_env = os.environ.copy() |
627 deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target | 634 deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target |
628 | 635 |
629 cmake_args = [] | 636 cmake_args = [] |
630 # TODO(thakis): Unconditionally append this to base_cmake_args instead once | 637 # TODO(thakis): Unconditionally append this to base_cmake_args instead once |
631 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698) | 638 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698) |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 args.force_local_build = True | 900 args.force_local_build = True |
894 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 901 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
895 # Only build the Android ASan rt on ToT bots when targetting Android. | 902 # Only build the Android ASan rt on ToT bots when targetting Android. |
896 args.with_android = False | 903 args.with_android = False |
897 | 904 |
898 return UpdateClang(args) | 905 return UpdateClang(args) |
899 | 906 |
900 | 907 |
901 if __name__ == '__main__': | 908 if __name__ == '__main__': |
902 sys.exit(main()) | 909 sys.exit(main()) |
OLD | NEW |