Skip to content

Commit 591a44f

Browse files
committed
Document the Cargo --target limitation
Closes #4
1 parent 03e2e04 commit 591a44f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@ cargo zigbuild --target aarch64-unknown-linux-gnu.2.17
2929

3030
## Limitations
3131

32-
Currently only Linux, macOS and Windows gnu targets are supported,
33-
other target platforms can be added if you can make it work,
34-
pull requests are welcome.
32+
1. Currently only Linux, macOS and Windows gnu targets are supported,
33+
other target platforms can be added if you can make it work,
34+
pull requests are welcome.
35+
2. If the `--target` argument is the same as the host target,
36+
for example when compiling from Linux x86\_64 to Linux x86\_64,
37+
Cargo by default also uses zig as linker for build dependencies like build scripts and proc-macros
38+
which might not work (See [#4](https://github.com/messense/cargo-zigbuild/issues/4)).
39+
You need to enable the unstable `target-applies-to-host` option and set `target-applies-to-host = false`
40+
in cargo configuration file, for example `.cargo/config.toml`, to make it work.
3541

3642
Known upstream zig issues:
3743

0 commit comments

Comments
 (0)