Merge pull request #1342 from ethereum/emscripten-codesize

Emscripten code size improvements [WIP TEST]
This commit is contained in:
chriseth 2016-11-25 18:07:10 +01:00 committed by GitHub
commit 9c2ed33e9a
2 changed files with 7 additions and 0 deletions

View File

@ -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()

View File

@ -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'