File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,6 +180,17 @@ IF (EMSCRIPTEN)
180180 ADD_LINK_FLAG ("-s DISABLE_EXCEPTION_CATCHING=0" )
181181 # make the tools immediately usable on Node.js
182182 ADD_LINK_FLAG ("-s NODERAWFS" )
183+ # this can be moved into the fastcomp section once upstream ignores this flag,
184+ # https://github.com/emscripten-core/emscripten/pull/9897
185+ ADD_COMPILE_FLAG ("-Wno-almost-asm" )
186+ # check for fastcomp by the clang version, which is stuck in fastcomp way
187+ # back in the past
188+ IF (${CMAKE_CXX_COMPILER_VERSION} STREQUAL "6.0.1" )
189+ ADD_LINK_FLAG ("-s ELIMINATE_DUPLICATE_FUNCTIONS=1" )
190+ ELSE ()
191+ # in opt builds, LTO helps so much (>20%) it's worth slow compile times
192+ ADD_NONDEBUG_COMPILE_FLAG ("-s WASM_OBJECT_FILES=0" )
193+ ENDIF ()
183194ENDIF ()
184195
185196# clang doesn't print colored diagnostics when invoked from Ninja
@@ -339,6 +350,7 @@ IF (EMSCRIPTEN)
339350 TARGET_LINK_LIBRARIES (binaryen_js "-s EXPORT_NAME=Binaryen" )
340351 TARGET_LINK_LIBRARIES (binaryen_js "--post-js ${CMAKE_CURRENT_SOURCE_DIR} /src/js/binaryen.js-post.js" )
341352 TARGET_LINK_LIBRARIES (binaryen_js optimized "--closure 1" )
353+ TARGET_LINK_LIBRARIES (binaryen_js optimized "--llvm-lto 1" )
342354 TARGET_LINK_LIBRARIES (binaryen_js debug "--profiling" )
343355 SET_PROPERTY (TARGET binaryen_js PROPERTY CXX_STANDARD 14 )
344356 SET_PROPERTY (TARGET binaryen_js PROPERTY CXX_STANDARD_REQUIRED ON )
You can’t perform that action at this time.
0 commit comments