Skip to content

Commit 872e7de

Browse files
committed
Patch to work around the removal of the USE_ES6_IMPORT_META option in new emscripten release. Removing import.meta.url makes sure that the wasm file is not embedded in the js file.
1 parent a543e37 commit 872e7de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build/wasm-x86/copy.native.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
[ "$1" != "" ] && [ ! -d "$1" ] && mkdir "$1"
55

6-
cp Q8/magick.js $1/magick.js
6+
sed 's/,import.meta.url//' Q8/magick.js > $1/magick.js
77
cp Q8/magick.constants.ts $1/magick.constants.ts
88
cp Q8/magick.d.ts $1/magick.d.ts
99
cp Q8/magick.wasm $1/magick.wasm

src/Magick.Native/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ file(GLOB_RECURSE ALL_FILES . *.c)
1919

2020
if (PLATFORM STREQUAL "WASM")
2121
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-entry -fexceptions -s STRICT=1")
22-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --bind --pre-js ${PROJECT_SOURCE_DIR}/../../build/wasm-x86/pre.js -s ALLOW_MEMORY_GROWTH=1 -s ALLOW_TABLE_GROWTH=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0 -s WASM_BIGINT=1 -s MAXIMUM_MEMORY=4294967296 -s ENVIRONMENT=web,webview,worker -s EXPORT_NAME=MagickNative -s ALLOW_UNIMPLEMENTED_SYSCALLS=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=FS,addFunction,getValue,lengthBytesUTF8,setValue,stringToUTF8,UTF8ToString -s STACK_SIZE=1MB")
22+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --bind --pre-js ${PROJECT_SOURCE_DIR}/../../build/wasm-x86/pre.js -s ALLOW_MEMORY_GROWTH=1 -s ALLOW_TABLE_GROWTH=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s WASM_BIGINT=1 -s MAXIMUM_MEMORY=4294967296 -s ENVIRONMENT=web,webview,worker -s EXPORT_NAME=MagickNative -s ALLOW_UNIMPLEMENTED_SYSCALLS=1 -s EXPORTED_FUNCTIONS=_malloc,_free -s EXPORTED_RUNTIME_METHODS=FS,addFunction,getValue,lengthBytesUTF8,setValue,stringToUTF8,UTF8ToString -s STACK_SIZE=1MB")
2323

2424
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
2525
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ASSERTIONS=2")

0 commit comments

Comments
 (0)