Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-compile support? #27

Open
linux-china opened this issue Mar 11, 2023 · 0 comments
Open

cross-compile support? #27

linux-china opened this issue Mar 11, 2023 · 0 comments

Comments

@linux-china
Copy link

linux-china commented Mar 11, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant