mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
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:
committed by
Ingvar Stepanyan
parent
bc8d75128f
commit
1542bfb7fd
@@ -2,6 +2,6 @@
|
|||||||
"name": "hqx",
|
"name": "hqx",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:image": "docker build -t squoosh-hqx .",
|
"build:image": "docker build -t squoosh-hqx .",
|
||||||
"build": "docker run --rm -v $(pwd):/src squoosh-hqx ./build.sh"
|
"build": "docker run -v $(pwd):/src squoosh-hqx ./build.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ echo "============================================="
|
|||||||
-I node_modules/libimagequant \
|
-I node_modules/libimagequant \
|
||||||
-o ./imagequant.js \
|
-o ./imagequant.js \
|
||||||
--std=c++11 \
|
--std=c++11 \
|
||||||
-x c++ \
|
|
||||||
imagequant.cpp \
|
imagequant.cpp \
|
||||||
node_modules/libimagequant/libimagequant.a
|
node_modules/libimagequant/libimagequant.a
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "imagequant",
|
"name": "imagequant",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "napa",
|
"install": "napa",
|
||||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
"build": "docker run -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
||||||
},
|
},
|
||||||
"napa": {
|
"napa": {
|
||||||
"libimagequant": "ImageOptim/libimagequant#2.12.1"
|
"libimagequant": "ImageOptim/libimagequant#2.12.1"
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ echo "Compiling mozjpeg"
|
|||||||
echo "============================================="
|
echo "============================================="
|
||||||
(
|
(
|
||||||
cd node_modules/mozjpeg
|
cd node_modules/mozjpeg
|
||||||
autoreconf -fiv
|
autoreconf -iv
|
||||||
emconfigure ./configure --without-simd
|
emconfigure ./configure -C --without-simd
|
||||||
emmake make libjpeg.la -j`nproc`
|
emmake make libjpeg.la rdswitch.o -j`nproc`
|
||||||
)
|
)
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "Compiling mozjpeg done"
|
echo "Compiling mozjpeg done"
|
||||||
@@ -31,18 +31,15 @@ echo "============================================="
|
|||||||
--bind \
|
--bind \
|
||||||
${OPTIMIZE} \
|
${OPTIMIZE} \
|
||||||
--closure 1 \
|
--closure 1 \
|
||||||
-s WASM=1 \
|
|
||||||
-s ALLOW_MEMORY_GROWTH=1 \
|
-s ALLOW_MEMORY_GROWTH=1 \
|
||||||
-s MODULARIZE=1 \
|
-s MODULARIZE=1 \
|
||||||
-s 'EXPORT_NAME="mozjpeg_enc"' \
|
-s 'EXPORT_NAME="mozjpeg_enc"' \
|
||||||
-I node_modules/mozjpeg \
|
-I node_modules/mozjpeg \
|
||||||
-o ./mozjpeg_enc.js \
|
-o ./mozjpeg_enc.js \
|
||||||
-Wno-deprecated-register \
|
-std=c++11 \
|
||||||
-Wno-writable-strings \
|
|
||||||
node_modules/mozjpeg/rdswitch.c \
|
|
||||||
-x c++ -std=c++11 \
|
|
||||||
mozjpeg_enc.cpp \
|
mozjpeg_enc.cpp \
|
||||||
node_modules/mozjpeg/.libs/libjpeg.a
|
node_modules/mozjpeg/.libs/libjpeg.a \
|
||||||
|
node_modules/mozjpeg/rdswitch.o
|
||||||
)
|
)
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "Compiling wasm bindings done"
|
echo "Compiling wasm bindings done"
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "cdjpeg.h"
|
#include "cdjpeg.h"
|
||||||
|
}
|
||||||
|
|
||||||
using namespace emscripten;
|
using namespace emscripten;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
"name": "mozjpeg_enc",
|
"name": "mozjpeg_enc",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "napa",
|
"install": "napa",
|
||||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
"build": "docker run -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
||||||
},
|
},
|
||||||
"napa": {
|
"napa": {
|
||||||
"mozjpeg": "mozilla/mozjpeg#v3.3.1"
|
"mozjpeg": "mozilla/mozjpeg#v3.3.1"
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
"name": "oxipng",
|
"name": "oxipng",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:image": "docker build -t squoosh-oxipng .",
|
"build:image": "docker build -t squoosh-oxipng .",
|
||||||
"build": "docker run --rm -v $(pwd):/src squoosh-oxipng ./build.sh"
|
"build": "docker run -v $(pwd):/src squoosh-oxipng ./build.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
"name": "resize",
|
"name": "resize",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:image": "docker build -t squoosh-resize .",
|
"build:image": "docker build -t squoosh-resize .",
|
||||||
"build": "docker run --rm -v $(pwd):/src squoosh-resize ./build.sh"
|
"build": "docker run -v $(pwd):/src squoosh-resize ./build.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "rotate",
|
"name": "rotate",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:image": "docker build -t squoosh-rotate .",
|
"build:image": "docker build -t squoosh-rotate .",
|
||||||
"build": "docker run --rm -v $(pwd):/src squoosh-rotate ./build.sh",
|
"build": "docker run -v $(pwd):/src squoosh-rotate ./build.sh",
|
||||||
"benchmark": "echo File size after gzip && npm run benchmark:filesize && echo Optimizing && npm run -s benchmark:optimizing",
|
"benchmark": "echo File size after gzip && npm run benchmark:filesize && echo Optimizing && npm run -s benchmark:optimizing",
|
||||||
"benchmark:baseline": "v8 --liftoff --no-wasm-tier-up --no-opt ./benchmark.js",
|
"benchmark:baseline": "v8 --liftoff --no-wasm-tier-up --no-opt ./benchmark.js",
|
||||||
"benchmark:optimizing": "v8 --no-liftoff --no-wasm-tier-up ./benchmark.js",
|
"benchmark:optimizing": "v8 --no-liftoff --no-wasm-tier-up ./benchmark.js",
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ echo "Compiling libwebp"
|
|||||||
echo "============================================="
|
echo "============================================="
|
||||||
test -n "$SKIP_LIBWEBP" || (
|
test -n "$SKIP_LIBWEBP" || (
|
||||||
cd node_modules/libwebp
|
cd node_modules/libwebp
|
||||||
autoreconf -fiv
|
autoreconf -iv
|
||||||
rm -rf build || true
|
emconfigure ./configure -C \
|
||||||
mkdir -p build && cd build
|
|
||||||
emconfigure ../configure \
|
|
||||||
--disable-libwebpdemux \
|
--disable-libwebpdemux \
|
||||||
--disable-wic \
|
--disable-wic \
|
||||||
--disable-gif \
|
--disable-gif \
|
||||||
@@ -44,12 +42,10 @@ echo "============================================="
|
|||||||
-s ALLOW_MEMORY_GROWTH=1 \
|
-s ALLOW_MEMORY_GROWTH=1 \
|
||||||
-s MODULARIZE=1 \
|
-s MODULARIZE=1 \
|
||||||
-s 'EXPORT_NAME="webp_dec"' \
|
-s 'EXPORT_NAME="webp_dec"' \
|
||||||
--std=c++11 \
|
|
||||||
-I node_modules/libwebp \
|
-I node_modules/libwebp \
|
||||||
-o ./webp_dec.js \
|
-o ./webp_dec.js \
|
||||||
-x c++ \
|
|
||||||
webp_dec.cpp \
|
webp_dec.cpp \
|
||||||
node_modules/libwebp/build/src/.libs/libwebp.a
|
node_modules/libwebp/src/.libs/libwebp.a
|
||||||
)
|
)
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "Compiling wasm bindings done"
|
echo "Compiling wasm bindings done"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "webp_dec",
|
"name": "webp_dec",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "napa",
|
"install": "napa",
|
||||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
"build": "docker run -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
||||||
},
|
},
|
||||||
"napa": {
|
"napa": {
|
||||||
"libwebp": "webmproject/libwebp#v1.0.2"
|
"libwebp": "webmproject/libwebp#v1.0.2"
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ echo "Compiling libwebp"
|
|||||||
echo "============================================="
|
echo "============================================="
|
||||||
test -n "$SKIP_LIBWEBP" || (
|
test -n "$SKIP_LIBWEBP" || (
|
||||||
cd node_modules/libwebp
|
cd node_modules/libwebp
|
||||||
autoreconf -fiv
|
autoreconf -iv
|
||||||
rm -rf build || true
|
emconfigure ./configure -C \
|
||||||
mkdir -p build && cd build
|
|
||||||
emconfigure ../configure \
|
|
||||||
--disable-libwebpdemux \
|
--disable-libwebpdemux \
|
||||||
--disable-wic \
|
--disable-wic \
|
||||||
--disable-gif \
|
--disable-gif \
|
||||||
@@ -45,12 +43,10 @@ echo "============================================="
|
|||||||
-s ALLOW_MEMORY_GROWTH=1 \
|
-s ALLOW_MEMORY_GROWTH=1 \
|
||||||
-s MODULARIZE=1 \
|
-s MODULARIZE=1 \
|
||||||
-s 'EXPORT_NAME="webp_enc"' \
|
-s 'EXPORT_NAME="webp_enc"' \
|
||||||
--std=c++11 \
|
|
||||||
-I node_modules/libwebp \
|
-I node_modules/libwebp \
|
||||||
-o ./webp_enc.js \
|
-o ./webp_enc.js \
|
||||||
-x c++ \
|
|
||||||
webp_enc.cpp \
|
webp_enc.cpp \
|
||||||
node_modules/libwebp/build/src/.libs/libwebp.a
|
node_modules/libwebp/src/.libs/libwebp.a
|
||||||
)
|
)
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "Compiling wasm bindings done"
|
echo "Compiling wasm bindings done"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "webp_enc",
|
"name": "webp_enc",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "napa",
|
"install": "napa",
|
||||||
"build": "docker run --rm -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
"build": "docker run -v $(pwd):/src trzeci/emscripten-upstream ./build.sh"
|
||||||
},
|
},
|
||||||
"napa": {
|
"napa": {
|
||||||
"libwebp": "webmproject/libwebp#v1.0.2"
|
"libwebp": "webmproject/libwebp#v1.0.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user