1# This file sets up a CMakeCache for a simple distribution bootstrap build.
2
3#Enable LLVM projects and runtimes
4set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
5set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
6
7# Only build the native target in stage1 since it is a throwaway build.
8set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
9
10# Optimize the stage1 compiler, but don't LTO it because that wastes time.
11set(CMAKE_BUILD_TYPE Release CACHE STRING "")
12
13# Setup vendor-specific settings.
14set(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.
18set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
19
20if (NOT APPLE)
21  # Since LLVM_ENABLE_LTO is ON we need a LTO capable linker
22  set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
23endif()
24
25# Expose stage2 targets through the stage1 build configuration.
26set(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.
40set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
41
42if(STAGE2_CACHE_FILE)
43  set(CLANG_BOOTSTRAP_CMAKE_ARGS
44    -C ${STAGE2_CACHE_FILE}
45    CACHE STRING "")
46else()
47  set(CLANG_BOOTSTRAP_CMAKE_ARGS
48    -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake
49    CACHE STRING "")
50endif()
51