-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibwebp.diff
27 lines (27 loc) · 1.27 KB
/
libwebp.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1ea7450c..a9f07c887 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -565,6 +565,22 @@ if(WEBP_BUILD_GIF2WEBP)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "GIF2WEBP_SRCS"
"gif2webp")
add_executable(gif2webp ${GIF2WEBP_SRCS})
+ set_target_properties(gif2webp PROPERTIES LINK_FLAGS "-s WASM=1 \
+ -s STRICT=1 \
+ -s ASSERTIONS=1 \
+ -s EXPORT_ES6=1 \
+ -s FILESYSTEM=1 \
+ -s INVOKE_RUN=0 \
+ -s MODULARIZE=1 \
+ -s MAIN_MODULE=2 \
+ -s EXIT_RUNTIME=0 \
+ -s ENVIRONMENT='web' \
+ -s ALLOW_MEMORY_GROWTH=1 \
+ -s ERROR_ON_UNDEFINED_SYMBOLS=0 \
+ -s EXPORT_NAME=loadGif2WebpWasm \
+ -s INCOMING_MODULE_JS_API=['locateFile'] \
+ -s EXPORTED_FUNCTIONS='[\"_main\",\"_malloc\",\"_DGifCloseFile\",\"_DGifGetExtension\",\"_DGifGetExtensionNext\",\"_DGifGetImageDesc\",\"_DGifGetLine\",\"_DGifGetRecordType\",\"_DGifOpenFileHandle\",\"_DGifOpenFileName\",\"_GifErrorString\"]' \
+ -s EXPORTED_RUNTIME_METHODS='[\"ccall\",\"cwrap\",\"FS\",\"stringToUTF8\",\"lengthBytesUTF8\",\"setValue\"]'")
target_link_libraries(gif2webp exampleutil imageioutil webp libwebpmux
${WEBP_DEP_GIF_LIBRARIES})
target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)