diff options
-rw-r--r-- | cmake/EthCompilerSettings.cmake | 3 | ||||
-rwxr-xr-x | scripts/travis-emscripten/build_emscripten.sh | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index af6ae928..97db9168 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -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() diff --git a/scripts/travis-emscripten/build_emscripten.sh b/scripts/travis-emscripten/build_emscripten.sh index 9ca53b89..a6eb01a0 100755 --- a/scripts/travis-emscripten/build_emscripten.sh +++ b/scripts/travis-emscripten/build_emscripten.sh @@ -95,8 +95,8 @@ emmake make -j 4 cd .. 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' |