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