[libc++][doc] Update the release notes for LLVM 18 (#78324)
[llvm-project.git] / clang / cmake / caches / Fuchsia.cmake
blobfe925901eb3dce7759578b57c7bc76f0130431e9
1 # This file sets up a CMakeCache for a Fuchsia toolchain build.
3 option(FUCHSIA_ENABLE_LLDB "Enable LLDB")
5 set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
7 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
9 set(_FUCHSIA_ENABLE_PROJECTS "bolt;clang;clang-tools-extra;libc;lld;llvm;polly")
11 set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "")
12 set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
13 set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
14 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
15 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
16 set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
17 set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
18 set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
19 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
20 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
21 set(LIBC_HDRGEN_ONLY ON CACHE BOOL "")
22 set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
23 set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
24 set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")
26 # Passthrough stage1 flags to stage1.
27 set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
28   LLVM_ENABLE_ZLIB
29   ZLIB_INCLUDE_DIR
30   ZLIB_LIBRARY
31   LLVM_ENABLE_ZSTD
32   zstd_DIR
33   LLVM_ENABLE_LIBXML2
34   LibXml2_ROOT
35   LLVM_ENABLE_CURL
36   LLVM_ENABLE_HTTPLIB
37   LLVM_ENABLE_TERMINFO
38   LLVM_ENABLE_LIBEDIT
39   CURL_ROOT
40   OpenSSL_ROOT
41   httplib_ROOT
43   # Deprecated
44   CursesAndPanel_ROOT
46   CURSES_INCLUDE_DIRS
47   CURSES_LIBRARIES
48   PANEL_LIBRARIES
50   # Deprecated
51   Terminfo_ROOT
53   Terminfo_LIBRARIES
55   # Deprecated
56   LibEdit_ROOT
58   LibEdit_INCLUDE_DIRS
59   LibEdit_LIBRARIES
61   FUCHSIA_ENABLE_LLDB
62   LLDB_ENABLE_CURSES
63   LLDB_ENABLE_LIBEDIT
64   LLDB_ENABLE_PYTHON
65   LLDB_EMBED_PYTHON_HOME
66   LLDB_PYTHON_HOME
67   LLDB_PYTHON_RELATIVE_PATH
68   Python3_EXECUTABLE
69   Python3_LIBRARIES
70   Python3_INCLUDE_DIRS
71   Python3_RPATH
72   CMAKE_FIND_PACKAGE_PREFER_CONFIG
73   CMAKE_SYSROOT
74   CMAKE_MODULE_LINKER_FLAGS
75   CMAKE_SHARED_LINKER_FLAGS
76   CMAKE_EXE_LINKER_FLAGS
77   LLVM_WINSYSROOT
78   LLVM_VFSOVERLAY
81 foreach(variable ${_FUCHSIA_BOOTSTRAP_PASSTHROUGH})
82   get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
83   if(${is_value_set})
84     get_property(value CACHE ${variable} PROPERTY VALUE)
85     get_property(type CACHE ${variable} PROPERTY TYPE)
86     set(BOOTSTRAP_${variable} "${value}" CACHE ${type} "")
87   endif()
88 endforeach()
90 set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
91 set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
92 set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
93 set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
94 set(CLANG_DEFAULT_UNWINDLIB libunwind CACHE STRING "")
95 set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
96 set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
97 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
99 set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
100 set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
102 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
103 set(LLVM_ENABLE_BACKTRACES ON CACHE BOOL "")
104 set(CMAKE_BUILD_TYPE Release CACHE STRING "")
105 if(APPLE)
106   set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
107 elseif(WIN32)
108   set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
109 endif()
111 if(APPLE)
112   set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
113   set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
114   set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
115 endif()
117 if(WIN32)
118   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
119   set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
120   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
121   set(BUILTINS_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
122   set(RUNTIMES_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
123   set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
124 else()
125   set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
126   set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
127   set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
128   set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
129   set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
130   set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
131   set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
132   set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
133   set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
134   set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
135   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
136   set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
137   set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
138   set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
139   set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
140 endif()
142 if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
143   set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")
144   if(STAGE2_LINUX_${target}_SYSROOT)
145     set(LLVM_BUILTIN_TARGETS "${target}" CACHE STRING "")
146     set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
147     set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
148     set(BUILTINS_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
150     set(LLVM_RUNTIME_TARGETS "${target}" CACHE STRING "")
151     set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
152     set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
153     set(RUNTIMES_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
154     set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
155     set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
156     set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
157     set(RUNTIMES_${target}_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
158     set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
159     set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
160     set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
161     set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
162     set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
163     set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
164     set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
165     set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
166     set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
167     set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
168     set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
169     set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
170     set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
171   endif()
172 endif()
174 set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
175 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
177 set(_FUCHSIA_BOOTSTRAP_TARGETS
178   check-all
179   check-clang
180   check-lld
181   check-llvm
182   check-polly
183   llvm-config
184   clang-test-depends
185   lld-test-depends
186   llvm-test-depends
187   test-suite
188   test-depends
189   toolchain-distribution
190   install-toolchain-distribution
191   install-toolchain-distribution-stripped
192   install-toolchain-distribution-toolchain
193   clang)
195 if(FUCHSIA_ENABLE_LLDB)
196   list(APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
197   list(APPEND _FUCHSIA_BOOTSTRAP_TARGETS
198     check-lldb
199     lldb-test-depends
200     debugger-distribution
201     install-debugger-distribution
202     install-debugger-distribution-stripped
203     install-debugger-distribution-toolchain)
204 endif()
206 set(LLVM_ENABLE_PROJECTS ${_FUCHSIA_ENABLE_PROJECTS} CACHE STRING "")
207 set(CLANG_BOOTSTRAP_TARGETS ${_FUCHSIA_BOOTSTRAP_TARGETS} CACHE STRING "")
209 get_cmake_property(variableNames VARIABLES)
210 foreach(variableName ${variableNames})
211   if(variableName MATCHES "^STAGE2_")
212     string(REPLACE "STAGE2_" "" new_name ${variableName})
213     string(REPLACE ";" "|" value "${${variableName}}")
214     list(APPEND EXTRA_ARGS "-D${new_name}=${value}")
215   endif()
216 endforeach()
218 # TODO: This is a temporary workaround until we figure out the right solution.
219 set(BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
221 # Setup the bootstrap build.
222 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
223 set(CLANG_BOOTSTRAP_EXTRA_DEPS
224   builtins
225   runtimes
226   CACHE STRING "")
227 set(CLANG_BOOTSTRAP_CMAKE_ARGS
228   ${EXTRA_ARGS}
229   -C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake
230   CACHE STRING "")