Skip to content

Commit

Permalink
Merge pull request ethereum#1342 from ethereum/emscripten-codesize
Browse files Browse the repository at this point in the history
Emscripten code size improvements [WIP TEST]
  • Loading branch information
chriseth authored Nov 25, 2016
2 parents d767782 + 7bbaeed commit 9c2ed33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA

if (EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0 -O3 -s LINKABLE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_DYNAMIC_EXECUTION=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s NO_FILESYSTEM=1 -s AGGRESSIVE_VARIABLE_ELIMINATION=1")
add_definitions(-DETH_EMSCRIPTEN=1)
endif()
endif()
Expand Down
4 changes: 4 additions & 0 deletions scripts/travis-emscripten/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ emmake make -j 4
cd ..
cp build/solc/soljson.js ./

OUTPUT_SIZE=`ls -la build/solc/soljson.js`

echo "Emscripten output size: ${OUTPUT_SIZE}"

echo -en 'travis_fold:end:compiling_solidity\\r'

0 comments on commit 9c2ed33

Please sign in to comment.