Skip to content

Commit b50683e

Browse files
committed
fix(llvm): use static LLVM linking on Windows
Windows doesn't support dynamic LLVM linking. Use target-specific dependencies: - Linux/macOS: `llvm17-0-force-dynamic` (dynamic linking) - Windows: `llvm17-0` (static linking)
1 parent 39d3398 commit b50683e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

compiler/ori_llvm/Cargo.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ repository = "https://github.com/upstat-io/ori-lang"
1010
# Build only in container: ./docker/llvm/run.sh cargo build -p ori_llvm
1111

1212
[dependencies]
13-
# LLVM bindings
14-
# Note: force-dynamic required for Linux/macOS. Windows doesn't support dynamic LLVM
15-
# linking in llvm-sys, so Windows builds are marked continue-on-error until we
16-
# set up a proper static LLVM build with all targets.
17-
inkwell = { version = "0.8", features = ["llvm17-0-force-dynamic"] }
18-
1913
# Ori crates (relative paths since excluded from workspace)
2014
ori_ir = { path = "../ori_ir" }
2115
ori_types = { path = "../ori_types" }
@@ -27,6 +21,15 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2721
# Concurrency primitives
2822
parking_lot = "0.12"
2923

24+
# LLVM bindings - platform-specific linking
25+
# Linux/macOS: dynamic linking (requires LLVM installed or in Docker)
26+
# Windows: static linking (requires pre-built LLVM package)
27+
[target.'cfg(not(windows))'.dependencies]
28+
inkwell = { version = "0.8", features = ["llvm17-0-force-dynamic"] }
29+
30+
[target.'cfg(windows)'.dependencies]
31+
inkwell = { version = "0.8", features = ["llvm17-0"] }
32+
3033
[dev-dependencies]
3134
pretty_assertions = "1.4"
3235

0 commit comments

Comments
 (0)