Skip to content

Commit

Permalink
CMakeLists: Move -Os for Emscripten to optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Mar 5, 2024
1 parent 7d2b361 commit 1bb0b37
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Expand Up @@ -462,10 +462,17 @@ elseif(GNU_GCC OR LLVM_CLANG)
# The following optimisation flags makes the engine code ~3 times
# faster, measured on a Atom CPU.
add_compile_options(
-O3
-ffast-math
-funroll-loops
)
if(EMSCRIPTEN)
# Optimize for size + speed when targeting Emscripten/WebAssembly
# This is recommended as we use asyncify:
# See https://doc.qt.io/qt-6/wasm.html#asyncify
add_compile_options(-Os)
else()
add_compile_options(-O3)
endif()
# set -fomit-frame-pointer when we don't profile and are not using
# Clang sanitizers.
# Note: It is only included in -O on machines where it does not
Expand Down Expand Up @@ -1589,7 +1596,7 @@ if(EMSCRIPTEN)
# We need asyncify to support asynchronous calls (e.g. QDialog::exec)
# when targeting Emscripten/WebAssembly.
# See https://doc.qt.io/qt-6/wasm.html#asyncify
target_link_options(mixxx-lib PUBLIC -sASYNCIFY -Os)
target_link_options(mixxx-lib PUBLIC -sASYNCIFY)
endif()

# QML Debugging
Expand Down

0 comments on commit 1bb0b37

Please sign in to comment.