From de61d17845b60880b18fe8bf8ed6c68d50b5aade Mon Sep 17 00:00:00 2001 From: Revertron Date: Sat, 17 Apr 2021 00:08:07 +0200 Subject: [PATCH] Added new configuration for cross-platform compilation. --- .cargo/config.toml | 27 +++++++++++++++++++++++++-- Cargo.toml | 6 +++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 1a803fa..b4ec3d0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,26 @@ [build] -#rustflags = ["-Ctarget-cpu=native"] -# or this: "-Ctarget-feature=+aes,+sha,+sse,+sse2,+avx,+avx2" \ No newline at end of file +#rustflags = ["-Ctarget-cpu=native", "-Clink-arg=-s"] +# or this: "-Ctarget-feature=+aes,+sha,+sse,+sse2,+avx,+avx2" + +# Build these targets like this: +# Install docker +# cargo install cross +# cross build --release --no-default-features --target x86_64-unknown-linux-musl + +[target.x86_64-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] + +[target.i686-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] + +[target.arm64-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] + +[target.armhf-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] + +[target.mips-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] + +[target.mipsel-unknown-linux-musl] +rustflags = ["-Ctarget-feature=+crt-static", "-Clink-arg=-s"] \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index b969978..c3dab7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alfis" -version = "0.4.5" +version = "0.4.6" authors = ["Revertron "] edition = "2018" build = "build.rs" @@ -56,6 +56,10 @@ winres = "0.1" serde_bytes = "0.11.5" serde_derive = "1.0.124" +[profile.release] +opt-level = 3 +lto = true + [profile.dev] opt-level = 2