2020-04-13 13:10:23 +02:00
#!/bin/sh
2020-06-22 13:52:30 +02:00
# Set rustflags without target-cpu to build for legacy hosts.
2020-05-26 18:18:21 +02:00
# I only build this for windows because Linux users on old machines can just compile their own binary
2020-06-22 13:52:30 +02:00
# --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
2020-05-26 18:18:21 +02:00
mv target/x86_64-pc-windows-gnu/release/adaptivegrain_rs.dll ./adaptivegrain_rs-no-fma.dll
2020-06-22 13:52:30 +02:00
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
2020-04-13 13:10:23 +02:00
mv target/x86_64-pc-windows-gnu/release/adaptivegrain_rs.dll ./
2020-05-26 18:18:21 +02:00
mv target/release/libadaptivegrain_rs.so ./
2020-04-13 13:10:23 +02:00
strip libadaptivegrain_rs.so
strip adaptivegrain_rs.dll
2020-05-26 18:18:21 +02:00
strip adaptivegrain_rs-no-fma.dll