style: move common optimization options to var
This commit is contained in:
parent
8fa8e98b99
commit
e2659df9b9
1 changed files with 6 additions and 4 deletions
10
.build.sh
10
.build.sh
|
@ -19,18 +19,20 @@ clone () {
|
||||||
|
|
||||||
# optimizations
|
# optimizations
|
||||||
set_cflags () {
|
set_cflags () {
|
||||||
|
opt="-Ofast -march=native"
|
||||||
export \
|
export \
|
||||||
CFLAGS="-std=gnu2x -Ofast -march=native" \
|
CFLAGS="-std=gnu2x $opt" \
|
||||||
CPPFLAGS="-Ofast -march=native" \
|
CPPFLAGS="$opt" \
|
||||||
LDFLAGS="-Wl,-O3" \
|
LDFLAGS="-Wl,-O3" \
|
||||||
RUSTFLAGS="-C target-cpu=native -C panic=abort"
|
RUSTFLAGS="-C target-cpu=native -C panic=abort"
|
||||||
}
|
}
|
||||||
|
|
||||||
# in a separate fn because ring does not build with LTO
|
# in a separate fn because ring does not build with LTO
|
||||||
use_lto () {
|
use_lto () {
|
||||||
|
lto="-flto=auto -fwhole-program"
|
||||||
export \
|
export \
|
||||||
CFLAGS="$CFLAGS -flto=auto -fwhole-program" \
|
CFLAGS="$CFLAGS $lto" \
|
||||||
CPPFLAGS="$CPPFLAGS -flto=auto -fwhole-program"
|
CPPFLAGS="$CPPFLAGS $lto"
|
||||||
}
|
}
|
||||||
|
|
||||||
# make -j12
|
# make -j12
|
||||||
|
|
Loading…
Add table
Reference in a new issue