diff options
author | Max Graey <maxgraey@gmail.com> | 2021-11-29 23:27:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-29 13:27:09 -0800 |
commit | 057df435a0b0cf707dc87bd6fec8dbdded697c58 (patch) | |
tree | 6bee26158e9a6a518a06084901c30996bd77780f | |
parent | 7f8d7ac89bd916f2fcbec2e14b40f653139ce5b6 (diff) | |
download | binaryen-057df435a0b0cf707dc87bd6fec8dbdded697c58.tar.gz binaryen-057df435a0b0cf707dc87bd6fec8dbdded697c58.tar.bz2 binaryen-057df435a0b0cf707dc87bd6fec8dbdded697c58.zip |
[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
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bb382430e..50bc769cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,12 +258,7 @@ else() endif() add_debug_compile_flag("-O0") add_debug_compile_flag("-g3") - if(EMSCRIPTEN) - # really focus on minimizing output size when compiling sources - add_nondebug_compile_flag("-Oz") - else() - add_nondebug_compile_flag("-O2") - endif() + add_nondebug_compile_flag("-O2") if(BYN_ENABLE_ASSERTIONS) # On non-Debug builds cmake automatically defines NDEBUG, so we # explicitly undefine it: |