CompileFlags:
  CompilationDatabase: ../../build
  Remove: [-sUSE_GLFW=3, -sUSE_WEBGL2=1, -sUSE_FREETYPE=1, -sUSE_SDL=2, -sUSE_SDL_MIXER=2, --use-port=*, -fmacro-prefix-map=*]
  Add:
    # Define WASM platform for Emscripten target
    - -DMS_PLATFORM_WASM=1
    # Emscripten-specific flags to help clangd understand the environment
    - -DMS_PLATFORM_WASM=1
    # Suppress warnings that are handled by Emscripten
    - -Wno-c++11-narrowing
    - -Wno-deprecated-declarations
    # Add Emscripten include paths
    - "-isystem/opt/homebrew/Cellar/emscripten/4.0.21/libexec/cache/sysroot/include/c++/v1"
    - "-isystem/opt/homebrew/Cellar/emscripten/4.0.21/libexec/cache/sysroot/include/compat"
    - "-isystem/opt/homebrew/Cellar/emscripten/4.0.21/libexec/cache/sysroot/include"
    - "-isystem/opt/homebrew/Cellar/emscripten/4.0.21/libexec/cache/sysroot/include/freetype2"
    - "-isystem/opt/homebrew/Cellar/emscripten/4.0.21/libexec/llvm/lib/clang/22/include"
    - "-target"
    - "wasm32-unknown-emscripten"
    - "--sysroot=/opt/homebrew/Cellar/emscripten/4.0.21/libexec/cache/sysroot"
