Chris Bieneman | 7e0f03e | 2016-10-26 15:41:38 +0000 | [diff] [blame] | 1 | # This file sets up a CMakeCache for a simple distribution bootstrap build. |
| 2 | |
Chris Bieneman | c1ad143f | 2019-05-20 18:10:20 +0000 | [diff] [blame] | 3 | #Enable LLVM projects and runtimes |
| 4 | set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "") |
Chris Bieneman | b67cb3c | 2019-06-05 17:35:38 +0000 | [diff] [blame] | 5 | set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "") |
Chris Bieneman | c1ad143f | 2019-05-20 18:10:20 +0000 | [diff] [blame] | 6 | |
Chris Bieneman | 7e0f03e | 2016-10-26 15:41:38 +0000 | [diff] [blame] | 7 | # Only build the native target in stage1 since it is a throwaway build. |
| 8 | set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "") |
| 9 | |
| 10 | # Optimize the stage1 compiler, but don't LTO it because that wastes time. |
| 11 | set(CMAKE_BUILD_TYPE Release CACHE STRING "") |
| 12 | |
| 13 | # Setup vendor-specific settings. |
| 14 | set(PACKAGE_VENDOR LLVM.org CACHE STRING "") |
| 15 | |
| 16 | # Setting up the stage2 LTO option needs to be done on the stage1 build so that |
| 17 | # the proper LTO library dependencies can be connected. |
| 18 | set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") |
| 19 | |
Chris Bieneman | b67cb3c | 2019-06-05 17:35:38 +0000 | [diff] [blame] | 20 | if (NOT APPLE) |
| 21 | # Since LLVM_ENABLE_LTO is ON we need a LTO capable linker |
| 22 | set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") |
| 23 | endif() |
| 24 | |
Chris Bieneman | 7e0f03e | 2016-10-26 15:41:38 +0000 | [diff] [blame] | 25 | # Expose stage2 targets through the stage1 build configuration. |
| 26 | set(CLANG_BOOTSTRAP_TARGETS |
| 27 | check-all |
| 28 | check-llvm |
| 29 | check-clang |
| 30 | llvm-config |
| 31 | test-suite |
| 32 | test-depends |
| 33 | llvm-test-depends |
| 34 | clang-test-depends |
| 35 | distribution |
| 36 | install-distribution |
| 37 | clang CACHE STRING "") |
| 38 | |
| 39 | # Setup the bootstrap build. |
| 40 | set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") |
NAKAMURA Takumi | 25f1a6e | 2017-05-11 13:19:24 +0000 | [diff] [blame] | 41 | |
| 42 | if(STAGE2_CACHE_FILE) |
| 43 | set(CLANG_BOOTSTRAP_CMAKE_ARGS |
| 44 | -C ${STAGE2_CACHE_FILE} |
| 45 | CACHE STRING "") |
| 46 | else() |
| 47 | set(CLANG_BOOTSTRAP_CMAKE_ARGS |
| 48 | -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake |
| 49 | CACHE STRING "") |
| 50 | endif() |