1 # This file sets up a CMakeCache for a Fuchsia toolchain build.
3 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
5 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
7 set(LLVM_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;lld;llvm;polly" CACHE STRING "")
9 set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
10 set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
11 set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
12 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
13 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
14 set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
15 set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
16 set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
17 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
18 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
19 set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
22 set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
25 set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
26 set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
27 set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
28 set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
29 set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
30 set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
31 set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
32 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
34 set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
35 set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
37 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
38 set(LLVM_ENABLE_BACKTRACES ON CACHE BOOL "")
39 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
41 set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
43 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
47 set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
48 set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
49 set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
53 set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
54 set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
55 set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
56 set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
57 set(BUILTINS_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
58 set(RUNTIMES_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
59 set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
61 set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
62 set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
63 set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
64 set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
65 set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
66 set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
67 set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
68 set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
69 set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
70 set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
71 set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
72 set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
73 set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
74 set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
77 if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
78 set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")
79 if(STAGE2_LINUX_${target}_SYSROOT)
80 set(LLVM_BUILTIN_TARGETS "${target}" CACHE STRING "")
81 set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
82 set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
83 set(BUILTINS_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
85 set(LLVM_RUNTIME_TARGETS "${target}" CACHE STRING "")
86 set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
87 set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
88 set(RUNTIMES_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
89 set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
90 set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
91 set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
92 set(RUNTIMES_${target}_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
93 set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
94 set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
95 set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
96 set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
97 set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
98 set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
99 set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
100 set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
101 set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
102 set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
103 set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
104 set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
105 set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
110 set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
111 set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
112 set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
115 set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
116 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
118 set(CLANG_BOOTSTRAP_TARGETS
132 install-distribution-stripped
133 install-distribution-toolchain
134 clang CACHE STRING "")
136 get_cmake_property(variableNames VARIABLES)
137 foreach(variableName ${variableNames})
138 if(variableName MATCHES "^STAGE2_")
139 string(REPLACE "STAGE2_" "" new_name ${variableName})
140 list(APPEND EXTRA_ARGS "-D${new_name}=${${variableName}}")
144 # Setup the bootstrap build.
145 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
146 set(CLANG_BOOTSTRAP_EXTRA_DEPS
150 set(CLANG_BOOTSTRAP_CMAKE_ARGS
152 -C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake