rust-maven-plugin
rust-maven-plugin copied to clipboard
cross-compile support?
Maybe somebody has asked this question before. Now I use cross to compile some jni-rs project, and shell script as following:
#!/bin/bash
# install cross
cargo install cross
# x86_64-unknown-linux-gnu
echo "compiling for x86_64-unknown-linux-gnu"
rustup target add x86_64-unknown-linux-gnu
cross build --release --target x86_64-unknown-linux-gnu
ls -la target/x86_64-unknown-linux-gnu/release
cp -f target/x86_64-unknown-linux-gnu/release/libmylib.so ../src/main/resources/libmylib-linux64.so
# x86_64-apple-darwin
echo "compiling for x86_64-apple-darwin"
rustup target add x86_64-apple-darwin
cross build --release --target x86_64-apple-darwin
ls -la target/x86_64-apple-darwin/release
cp target/x86_64-apple-darwin/release/libmylib.dylib ../src/main/resources/libmylib-osx-x86_64.dylib
# x86_64-pc-windows-gnu
echo "compiling for x86_64-pc-windows-gnu"
rustup target add x86_64-pc-windows-gnu
cross build --release --target x86_64-pc-windows-gnu
ls -la target/x86_64-pc-windows-gnu/release
cp -f target/x86_64-pc-windows-gnu/release/mylib.dll ../src/main/resources/libmylib-win64.dll
Is it possible to add cross-compile support for rust-maven-plugin?