Skip to content

Commit ff4578c

Browse files
authored
Document better the cross-compiling pitfalls.
1 parent d4e25a2 commit ff4578c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,24 @@ a compatible `configure` script + `make`.
1313
It is based on [cmake-rs](https://github.com/alexcrichton/cmake-rs) and
1414
the API tries to be as similar as possible to it.
1515

16+
## Cross compiling
17+
18+
### Emscripten
1619
For Emscripten targets like "wasm32-unknown-emscripten", `configure` and
1720
`make` invocations are passed as arguments to `emconfigure` and `emmake`
1821
respectively as described in the [Emscripten docs](https://emscripten.org/docs/compiling/Building-Projects.html#integrating-with-a-build-system).
1922

23+
### Custom LLVM on macOS
24+
Make sure to set the env to `CC=clang-{version}` and that the compiler is in the `PATH`. If you are using [install-llvm-action](https://github.com/KyleMayes/install-llvm-action),
25+
make sure to set [`env: true`](https://github.com/KyleMayes/install-llvm-action#env).
26+
27+
### Other compilers
28+
Keep in mind that we rely on `cc-rs` heuristics to select the C and C++ compilers. Some may be missing on your system, please make sure to set
29+
the [enviroment variables](https://github.com/rust-lang/cc-rs#external-configuration-via-environment-variables) to select the correct compiler if
30+
the heuristics fail (e.g. `musl-gcc` might not exist while `x86_64-linux-musl-gcc` does).
31+
32+
33+
2034
``` toml
2135
# Cargo.toml
2236
[build-dependencies]

0 commit comments

Comments
 (0)