From 40604b2692279d6d37fd3f854b9e97d76c067b4b Mon Sep 17 00:00:00 2001 From: kageru Date: Mon, 22 Jun 2020 13:52:30 +0200 Subject: [PATCH] update build script --- build_release.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build_release.sh b/build_release.sh index 333919f..f7434bc 100755 --- a/build_release.sh +++ b/build_release.sh @@ -1,11 +1,12 @@ #!/bin/sh -# Set rustflags as empty to build for legacy hosts. +# Set rustflags without target-cpu to build for legacy hosts. # I only build this for windows because Linux users on old machines can just compile their own binary -RUSTFLAGS="" cargo build --release --target=x86_64-pc-windows-gnu --locked +# --emit=asm forces rustc to compile the crate with only one thread, which can help the optimizer (1-2% faster on my machine) +RUSTFLAGS="--emit asm" cargo build --release --target=x86_64-pc-windows-gnu --locked mv target/x86_64-pc-windows-gnu/release/adaptivegrain_rs.dll ./adaptivegrain_rs-no-fma.dll -RUSTFLAGS="-C target-cpu=haswell" cargo build --release --locked -RUSTFLAGS="-C target-cpu=haswell" cargo build --release --target=x86_64-pc-windows-gnu --locked +RUSTFLAGS="-C target-cpu=haswell --emit asm" cargo build --release --locked +RUSTFLAGS="-C target-cpu=haswell --emit asm" cargo build --release --target=x86_64-pc-windows-gnu --locked mv target/x86_64-pc-windows-gnu/release/adaptivegrain_rs.dll ./ mv target/release/libadaptivegrain_rs.so ./ strip libadaptivegrain_rs.so