blob: 50fcc09cf078cd893c9d7e2b404936da6c162270 [file] [log] [blame]
Chris Bieneman7e0f03e2016-10-26 15:41:38 +00001# This file sets up a CMakeCache for a simple distribution bootstrap build.
2
Chris Bienemanc1ad143f2019-05-20 18:10:20 +00003#Enable LLVM projects and runtimes
4set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld" CACHE STRING "")
Chris Bienemanb67cb3c2019-06-05 17:35:38 +00005set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi" CACHE STRING "")
Chris Bienemanc1ad143f2019-05-20 18:10:20 +00006
Chris Bieneman7e0f03e2016-10-26 15:41:38 +00007# 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
Chris Bienemanb67cb3c2019-06-05 17:35:38 +000020if (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
Chris Bieneman7e0f03e2016-10-26 15:41:38 +000025# 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 "")
NAKAMURA Takumi25f1a6e2017-05-11 13:19:24 +000041
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()