Compare commits

..

3 Commits

Author SHA1 Message Date
4fa2191233 update ChangeLog
Bug: webp:427525168
Change-Id: Ic3542c736a4cea3ec3b6529fe546ce9267295169
2025-07-07 17:20:00 -07:00
370aa5817e webp_js/README.md: add some more code formatting (``)
Bug: webp:427525168
Change-Id: I979d0e7406ecc482a5ebb7d94cc50117f8384acc
2025-07-07 15:34:31 -07:00
f83c6b328f CMakeLists: add warning for incorrect emscripten config
`-DWEBP_BUILD_WEBP_JS=1` requires `emcmake` and `emmake`. Attempt to
detect `emcmake` usage by checking for the `EMSCRIPTEN_VERSION`
variable and issue a warning if it is not set. This may help avoid a
surprising build error as `cmake` itself will succeed:

```
$ make
[...]
[100%] Building C object CMakeFiles/webp_wasm.dir/extras/webp_to_sdl.c.o
clang: error: no such file or directory: 'SDL2::SDL2'
```

Bug: webp:427525168
Change-Id: I4f5fa2ffbbc4123e28172f2b7ef952a1b1a687bf
2025-07-07 14:15:07 -07:00
3 changed files with 15 additions and 3 deletions

View File

@ -84,6 +84,15 @@ if(WEBP_BUILD_WEBP_JS)
message(NOTICE
"wasm2js does not support SIMD, disabling webp.js generation.")
endif()
if(NOT EMSCRIPTEN_VERSION)
message(
WARNING
"EMSCRIPTEN_VERSION not detected!\n"
"WEBP_BUILD_WEBP_JS is only supported with emcmake/emmake.\n"
"The build may fail if those tools are not used. See webp_js/README.md."
)
endif()
endif()
set(SHARPYUV_DEP_LIBRARIES)

View File

@ -1,3 +1,6 @@
370aa581 webp_js/README.md: add some more code formatting (``)
f83c6b32 CMakeLists: add warning for incorrect emscripten config
6a3e656b update ChangeLog (tag: v1.6.0-rc1)
bf0bf1e7 api.md: add WebPValidateDecoderConfig to pseudocode
e8ae210d update NEWS
ce53efd7 bump version to 1.6.0

View File

@ -13,7 +13,7 @@ Emscripten and CMake.
- install the Emscripten SDK following the procedure described at:
https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended
After installation, you should have some global variable positioned to the
location of the SDK. In particular, $EMSDK should point to the top-level
location of the SDK. In particular, `$EMSDK` should point to the top-level
directory containing Emscripten tools.
- configure the project 'WEBP_JS' with CMake using:
@ -23,12 +23,12 @@ Emscripten and CMake.
emcmake cmake -DWEBP_BUILD_WEBP_JS=ON ../
```
- compile webp.js using 'emmake make'.
- compile webp.js using `emmake make`.
- that's it! Upon completion, you should have the 'webp.js', 'webp.js.mem',
'webp_wasm.js' and 'webp_wasm.wasm' files generated.
The callable JavaScript function is WebPToSDL(), which decodes a raw WebP
The callable JavaScript function is `WebPToSDL()`, which decodes a raw WebP
bitstream into a canvas. See webp_js/index.html for a simple usage sample (see
below for instructions).