Skip to content

Commit 1e6e71c

Browse files
committed
cmake: add a cache for Windows ARM64 toolchains
This adds a CMake cache for the Windows ARM64 toolchain. It is possible to build and run the toolchain on ARM64, though we have not had regular releases of the toolchain. This adds the cache used to generate the toolchain in the hopes that it is useful for others and that we can soon get more regular ARM64 toolchain builds.
1 parent 11d2837 commit 1e6e71c

File tree

1 file changed

+164
-0
lines changed

1 file changed

+164
-0
lines changed

cmake/caches/Windows-arm64.cmake

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
set(LLVM_ENABLE_PROJECTS
2+
clang
3+
clang-tools-extra
4+
lld
5+
lldb
6+
CACHE STRING "")
7+
8+
set(LLVM_EXTERNAL_PROJECTS
9+
cmark
10+
swift
11+
CACHE STRING "")
12+
13+
set(LLVM_ENABLE_RUNTIMES
14+
compiler-rt
15+
CACHE STRING "")
16+
17+
# NOTE(compnerd) always enable assertions, the toolchain will not provide enough
18+
# context to resolve issues otherwise and may silently generate invalid output.
19+
set(LLVM_ENABLE_ASSERTIONS YES CACHE BOOL "")
20+
21+
set(ENABLE_X86_RELAX_RELOCATIONS YES CACHE BOOL "")
22+
23+
# NOTE(compnerd) we can hardcode the default target triple since the cache files
24+
# are target dependent.
25+
set(LLVM_DEFAULT_TARGET_TRIPLE aarch64-unknown-windows-msvc CACHE STRING "")
26+
27+
set(LLVM_APPEND_VC_REV NO CACHE BOOL "")
28+
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR YES CACHE BOOL "")
29+
set(LLVM_ENABLE_PYTHON YES CACHE BOOL "")
30+
set(LLVM_RUNTIME_TARGETS
31+
aarch64-unknown-windows-msvc
32+
CACHE STRING "")
33+
foreach(target ${LLVM_RUNTIME_TARGETS})
34+
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES
35+
compiler-rt
36+
CACHE STRING "")
37+
set(RUNTIMES_${target}_CMAKE_MT mt CACHE STRING "")
38+
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
39+
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
40+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_CRT NO CACHE BOOL "")
41+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_LIBFUZZER NO CACHE BOOL "")
42+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_PROFILE YES CACHE BOOL "")
43+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_SANITIZERS NO CACHE BOOL "")
44+
set(RUNTIMES_${target}_COMPILER_RT_BUILD_XRAY NO CACHE BOOL "")
45+
endforeach()
46+
47+
set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
48+
49+
# Disable certain targets to reduce the configure time or to avoid configuration
50+
# differences (and in some cases weird build errors on a complete build).
51+
set(LLVM_BUILD_LLVM_DYLIB NO CACHE BOOL "")
52+
set(LLVM_BUILD_LLVM_C_DYLIB NO CACHE BOOL "")
53+
set(LLVM_ENABLE_LIBEDIT NO CACHE BOOL "")
54+
set(LLVM_ENABLE_LIBXML2 NO CACHE BOOL "")
55+
set(LLVM_ENABLE_OCAMLDOC NO CACHE BOOL "")
56+
set(LLVM_ENABLE_TERMINFO NO CACHE BOOL "")
57+
set(LLVM_ENABLE_Z3_SOLVER NO CACHE BOOL "")
58+
set(LLVM_ENABLE_ZLIB NO CACHE BOOL "")
59+
set(LLVM_INCLUDE_BENCHMARKS NO CACHE BOOL "")
60+
set(LLVM_INCLUDE_DOCS NO CACHE BOOL "")
61+
set(LLVM_INCLUDE_EXAMPLES NO CACHE BOOL "")
62+
set(LLVM_INCLUDE_GO_TESTS NO CACHE BOOL "")
63+
set(LLVM_TOOL_GOLD_BUILD NO CACHE BOOL "")
64+
set(LLVM_TOOL_LLVM_SHLIB_BUILD NO CACHE BOOL "")
65+
66+
# Avoid swig dependency for lldb
67+
set(LLDB_ALLOW_STATIC_BINDINGS YES CACHE BOOL "")
68+
set(LLDB_USE_STATIC_BINDINGS YES CACHE BOOL "")
69+
70+
# This requires perl which may not be available on Windows
71+
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
72+
set(SWIFT_BUILD_ENABLE_PARSER_LIB YES CACHE BOOL "")
73+
# static linking is not supported on Windows yet
74+
set(SWIFT_BUILD_STATIC_STDLIB NO CACHE BOOL "")
75+
set(SWIFT_BUILD_STATIC_SDK_OVERLAY NO CACHE BOOL "")
76+
77+
set(LLVM_INSTALL_BINUTILS_SYMLINKS YES CACHE BOOL "")
78+
set(LLVM_INSTALL_TOOLCHAIN_ONLY YES CACHE BOOL "")
79+
set(LLVM_TOOLCHAIN_TOOLS
80+
addr2line
81+
ar
82+
c++filt
83+
dsymutil
84+
dwp
85+
# lipo
86+
llvm-ar
87+
llvm-cov
88+
llvm-cvtres
89+
llvm-cxxfilt
90+
llvm-dlltool
91+
llvm-dwarfdump
92+
llvm-dwp
93+
llvm-lib
94+
llvm-lipo
95+
llvm-mt
96+
llvm-nm
97+
llvm-objcopy
98+
llvm-objdump
99+
llvm-pdbutil
100+
llvm-profdata
101+
llvm-ranlib
102+
llvm-rc
103+
llvm-readelf
104+
llvm-readobj
105+
llvm-size
106+
llvm-strings
107+
llvm-strip
108+
llvm-symbolizer
109+
llvm-undname
110+
nm
111+
objcopy
112+
objdump
113+
ranlib
114+
readelf
115+
size
116+
strings
117+
CACHE STRING "")
118+
119+
set(CLANG_TOOLS
120+
clang
121+
clangd
122+
clang-format
123+
clang-resource-headers
124+
clang-tidy
125+
CACHE STRING "")
126+
127+
set(LLD_TOOLS
128+
lld
129+
CACHE STRING "")
130+
131+
set(LLDB_TOOLS
132+
liblldb
133+
lldb
134+
lldb-argdumper
135+
lldb-python-scripts
136+
lldb-server
137+
lldb-vscode
138+
repl_swift
139+
CACHE STRING "")
140+
141+
set(SWIFT_INSTALL_COMPONENTS
142+
autolink-driver
143+
compiler
144+
clang-builtin-headers
145+
editor-integration
146+
tools
147+
sourcekit-inproc
148+
swift-remote-mirror
149+
swift-remote-mirror-headers
150+
parser-lib
151+
CACHE STRING "")
152+
153+
set(LLVM_DISTRIBUTION_COMPONENTS
154+
IndexStore
155+
libclang
156+
libclang-headers
157+
LTO
158+
runtimes
159+
${LLVM_TOOLCHAIN_TOOLS}
160+
${CLANG_TOOLS}
161+
${LLD_TOOLS}
162+
${LLDB_TOOLS}
163+
${SWIFT_INSTALL_COMPONENTS}
164+
CACHE STRING "")

0 commit comments

Comments
 (0)