aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/EthCompilerSettings.cmake
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-11-09 07:11:51 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2016-11-09 10:46:47 +0800
commit7bbaeedc317096ef89a10c87313f15b020d5adee (patch)
treebfa9fb19c28bf00d86ad863ad780b4f029a25c73 /cmake/EthCompilerSettings.cmake
parent6e0934664b7da3b09fc6294fa39c756670f46f52 (diff)
downloaddexon-solidity-7bbaeedc317096ef89a10c87313f15b020d5adee.tar.gz
dexon-solidity-7bbaeedc317096ef89a10c87313f15b020d5adee.tar.zst
dexon-solidity-7bbaeedc317096ef89a10c87313f15b020d5adee.zip
Add optimisation flags for Emscripten
Diffstat (limited to 'cmake/EthCompilerSettings.cmake')
-rw-r--r--cmake/EthCompilerSettings.cmake3
1 files changed, 3 insertions, 0 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()