Make emscripten with threads compile

This commit is contained in:
Surma
2018-11-02 18:34:23 +00:00
parent 30e78e8ab7
commit 7a08815bcf
5 changed files with 4 additions and 6 deletions

BIN
codecs/really_big.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 MiB

View File

@@ -14,14 +14,12 @@ echo "============================================="
emcc \ emcc \
${OPTIMIZE} \ ${OPTIMIZE} \
--bind \ --bind \
-D WEBP_USE_THREAD \ -D WEBP_USE_THREAD=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s USE_PTHREADS=1 \ -s USE_PTHREADS=1 \
-s ASSERTIONS=1 \ -s ASSERTIONS=1 \
-s PTHREAD_POOL_SIZE=2 \ -s PTHREAD_POOL_SIZE=4 \
-s TOTAL_MEMORY=268435456 \ -s TOTAL_MEMORY=268435456 \
-s WASM_MEM_MAX=268435456 \ -s WASM_MEM_MAX=268435456 \
-s 'EXPORT_NAME="webp_enc"' \
--std=c++11 \ --std=c++11 \
-I node_modules/libwebp \ -I node_modules/libwebp \
-o ./webp_enc.js \ -o ./webp_enc.js \

View File

@@ -19,7 +19,7 @@
Module.onRuntimeInitialized = async _ => { Module.onRuntimeInitialized = async _ => {
console.log('Version:', Module.version().toString(16)); console.log('Version:', Module.version().toString(16));
const image = await loadImage('../example.png'); const image = await loadImage('../really_big.jpg');
let start = performance.now(); let start = performance.now();
const result = Module.encode(image.data, image.width, image.height, { const result = Module.encode(image.data, image.width, image.height, {
quality: 75, quality: 75,

File diff suppressed because one or more lines are too long

Binary file not shown.