Add optimisation flags for Emscripten

This commit is contained in:
Alex Beregszaszi 2016-11-08 23:11:51 +00:00
parent 6e0934664b
commit 7bbaeedc31
2 changed files with 5 additions and 2 deletions

View File

@ -155,6 +155,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
if (EMSCRIPTEN) 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} --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) add_definitions(-DETH_EMSCRIPTEN=1)
endif() endif()
endif() endif()

View File

@ -95,8 +95,8 @@ emmake make -j 4
cd .. cd ..
cp build/solc/soljson.js ./ cp build/solc/soljson.js ./
OUTPUT_SIZE=`stat -f "%z" build/solc/soljson.js` OUTPUT_SIZE=`ls -la build/solc/soljson.js`
echo "Emscripten output size: $OUTPUT_SIZE" echo "Emscripten output size: ${OUTPUT_SIZE}"
echo -en 'travis_fold:end:compiling_solidity\\r' echo -en 'travis_fold:end:compiling_solidity\\r'