Clang Project

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