mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-19 18:15:18 -07:00
Add wasi --bench
This commit is contained in:
parent
449e6d12b9
commit
59b1c31acf
@ -12,4 +12,5 @@ EXTRA_DIST = \
|
|||||||
ios.sh \
|
ios.sh \
|
||||||
msys2-win32.sh \
|
msys2-win32.sh \
|
||||||
msys2-win64.sh \
|
msys2-win64.sh \
|
||||||
watchos.sh
|
watchos.sh \
|
||||||
|
wasi.sh
|
||||||
|
@ -23,6 +23,12 @@ make distclean > /dev/null
|
|||||||
grep -q -F -- '-wasi' build-aux/config.sub || \
|
grep -q -F -- '-wasi' build-aux/config.sub || \
|
||||||
sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub
|
sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub
|
||||||
|
|
||||||
|
if [ "x$1" = "x--bench" ]; then
|
||||||
|
export BENCHMARKS=1
|
||||||
|
export LIBSODIUM_FULL_BUILD=1
|
||||||
|
export CPPFLAGS="-DBENCHMARKS -DITERATIONS=50"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
||||||
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
||||||
else
|
else
|
||||||
@ -36,7 +42,8 @@ fi
|
|||||||
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
||||||
PROCESSORS=${NPROCESSORS:-3}
|
PROCESSORS=${NPROCESSORS:-3}
|
||||||
|
|
||||||
make -j${PROCESSORS} check || exit 1
|
if [ -z "$BENCHMARKS" ]; then
|
||||||
make install || exit 1
|
make -j${PROCESSORS} && make check
|
||||||
|
else
|
||||||
make distclean > /dev/null
|
make -j${PROCESSORS} check && make install && make distclean > /dev/null
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user