My project is a 32-bit dynamic library: it injects into a 32-bit game process. Right now my build instructions boil down to:
Linux
- Install the
i686-unknown-linux-gnu
target cargo build --target=i686-unknown-linux-gnu
Windows
- Install the
i686-pc-windows-msvc
target cargo build --target=i686-pc-windows-msvc
And I have a .cargo/config
with:
[build]
#target = "i686-unknown-linux-gnu"
#target = "i686-pc-windows-msvc"
#target = "i686-pc-windows-gnu"
for people to uncomment as they see fit.
However, it would be better if I could somehow tell cargo to use i686-unknown-linux-gnu
on Linux and i686-pc-windows-msvc
on Windows automatically, to simplify the build instructions to a cargo build
. Is this possible? Something like [build."cfg(windows)"]
and [build."cfg(not(windows))"]
in .cargo/config
seems like it would work.