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