]> granicus.if.org Git - clang/blob - cmake/caches/DistributionExample.cmake
Fix two-stage build on windows using DistributionExample cmake cache
[clang] / 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.
4 set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
5
6 # Optimize the stage1 compiler, but don't LTO it because that wastes time.
7 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
8
9 # Setup vendor-specific settings.
10 set(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.
14 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
15
16 # Expose stage2 targets through the stage1 build configuration.
17 set(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.
31 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
32
33 if(STAGE2_CACHE_FILE)
34   set(CLANG_BOOTSTRAP_CMAKE_ARGS
35     -C ${STAGE2_CACHE_FILE}
36     CACHE STRING "")
37 else()
38   set(CLANG_BOOTSTRAP_CMAKE_ARGS
39     -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake
40     CACHE STRING "")
41 endif()