Skip to content

Commit ced1fda

Browse files
committed
Exclude Windows from LLVM_LINK_LLVM_DYLIB
1 parent 1636a2c commit ced1fda

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bootstrap/native.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,19 @@ impl Step for Llvm {
125125
.define("WITH_POLLY", "OFF")
126126
.define("LLVM_ENABLE_TERMINFO", "OFF")
127127
.define("LLVM_ENABLE_LIBEDIT", "OFF")
128-
.define("LLVM_LINK_LLVM_DYLIB", "ON")
129128
.define("LLVM_PARALLEL_COMPILE_JOBS", build.jobs().to_string())
130129
.define("LLVM_TARGET_ARCH", target.split('-').next().unwrap())
131130
.define("LLVM_DEFAULT_TARGET_TRIPLE", target);
132131

132+
133+
// This setting makes the LLVM tools link to the dynamic LLVM library,
134+
// which saves both memory during parallel links and overall disk space
135+
// for the tools. We don't distribute any of those tools, so this is
136+
// just a local concern. However, this doesn't seem to work on Windows.
137+
if !target.contains("windows") {
138+
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
139+
}
140+
133141
if target.contains("msvc") {
134142
cfg.define("LLVM_USE_CRT_DEBUG", "MT");
135143
cfg.define("LLVM_USE_CRT_RELEASE", "MT");

0 commit comments

Comments
 (0)