Skip to content

Commit 10c742e

Browse files
committed
Update emscripten build to be compatible with new docker image.
1 parent d0c8c79 commit 10c742e

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

cmake/EthCompilerSettings.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
150150
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM_ASYNC_COMPILATION=0")
151151
# Output a single js file with the wasm binary embedded as base64 string.
152152
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s SINGLE_FILE=1")
153-
153+
# Allow new functions to be added to the wasm module via addFunction.
154+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_TABLE_GROWTH=1")
154155
# Disable warnings about not being pure asm.js due to memory growth.
155156
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-almost-asm")
156157
endif()

cmake/toolchains/emscripten.cmake

Lines changed: 0 additions & 2 deletions
This file was deleted.

libsolc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if (EMSCRIPTEN)
22
# Specify which functions to export in soljson.js.
33
# Note that additional Emscripten-generated methods needed by solc-js are
44
# defined to be exported in cmake/EthCompilerSettings.cmake.
5-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_solidity_license\",\"_solidity_version\",\"_solidity_compile\",\"_solidity_alloc\",\"_solidity_free\",\"_solidity_reset\"]' -s RESERVED_FUNCTION_POINTERS=20")
5+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_solidity_license\",\"_solidity_version\",\"_solidity_compile\",\"_solidity_alloc\",\"_solidity_free\",\"_solidity_reset\"]'")
66
add_executable(soljson libsolc.cpp libsolc.h)
77
target_link_libraries(soljson PRIVATE solidity)
88
else()

scripts/ci/build_emscripten.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ fi
5656

5757
mkdir -p $BUILD_DIR
5858
cd $BUILD_DIR
59-
cmake \
60-
-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/emscripten.cmake \
59+
emcmake cmake \
6160
-DCMAKE_BUILD_TYPE=Release \
6261
-DBoost_USE_STATIC_LIBS=1 \
6362
-DBoost_USE_STATIC_RUNTIME=1 \

0 commit comments

Comments
 (0)