xref: /llvm-project/clang/cmake/caches/DistributionExample.cmake (revision c1ad143f95da3b18d1ec2eea50d418cbbfab1a2b)
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" 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
20# Expose stage2 targets through the stage1 build configuration.
21set(CLANG_BOOTSTRAP_TARGETS
22  check-all
23  check-llvm
24  check-clang
25  llvm-config
26  test-suite
27  test-depends
28  llvm-test-depends
29  clang-test-depends
30  distribution
31  install-distribution
32  clang CACHE STRING "")
33
34# Setup the bootstrap build.
35set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
36
37if(STAGE2_CACHE_FILE)
38  set(CLANG_BOOTSTRAP_CMAKE_ARGS
39    -C ${STAGE2_CACHE_FILE}
40    CACHE STRING "")
41else()
42  set(CLANG_BOOTSTRAP_CMAKE_ARGS
43    -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake
44    CACHE STRING "")
45endif()
46