Skip to content

Commit 057df43

Browse files
authored
[CMake] Use -O2 for all targets in compile step (#4360)
Previously Emscripten used -Oz. That does reduce code size, but it turns out to make binaryen.js significantly slower (3x or more) than it could be, which seems like the wrong tradeoff. Fixes #4359
1 parent 7f8d7ac commit 057df43

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,7 @@ else()
258258
endif()
259259
add_debug_compile_flag("-O0")
260260
add_debug_compile_flag("-g3")
261-
if(EMSCRIPTEN)
262-
# really focus on minimizing output size when compiling sources
263-
add_nondebug_compile_flag("-Oz")
264-
else()
265-
add_nondebug_compile_flag("-O2")
266-
endif()
261+
add_nondebug_compile_flag("-O2")
267262
if(BYN_ENABLE_ASSERTIONS)
268263
# On non-Debug builds cmake automatically defines NDEBUG, so we
269264
# explicitly undefine it:

0 commit comments

Comments
 (0)