Tweak up compile flags

- Remove unnecessary `-x c++`.
 - Improve rebuild speed by caching:
   - Remove `-f` from `autoreconf` to reuse generated configure scripts.
   - Remove `--rm` from `docker run` to avoid rebuilding Emscripten stdlib.
   - Add `-C` to `./configure` to reuse stored information about `emcc`.
   - Remove `rm -rf build` from WebP encoder/decoder.
This commit is contained in:
Ingvar Stepanyan
2020-05-11 21:21:07 +01:00
committed by Ingvar Stepanyan
parent bc8d75128f
commit 1542bfb7fd
14 changed files with 23 additions and 32 deletions

View File

@@ -15,9 +15,9 @@ echo "Compiling mozjpeg"
echo "============================================="
(
cd node_modules/mozjpeg
autoreconf -fiv
emconfigure ./configure --without-simd
emmake make libjpeg.la -j`nproc`
autoreconf -iv
emconfigure ./configure -C --without-simd
emmake make libjpeg.la rdswitch.o -j`nproc`
)
echo "============================================="
echo "Compiling mozjpeg done"
@@ -31,18 +31,15 @@ echo "============================================="
--bind \
${OPTIMIZE} \
--closure 1 \
-s WASM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s 'EXPORT_NAME="mozjpeg_enc"' \
-I node_modules/mozjpeg \
-o ./mozjpeg_enc.js \
-Wno-deprecated-register \
-Wno-writable-strings \
node_modules/mozjpeg/rdswitch.c \
-x c++ -std=c++11 \
-std=c++11 \
mozjpeg_enc.cpp \
node_modules/mozjpeg/.libs/libjpeg.a
node_modules/mozjpeg/.libs/libjpeg.a \
node_modules/mozjpeg/rdswitch.o
)
echo "============================================="
echo "Compiling wasm bindings done"