42c14fae59
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.6 KiB
2.6 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, example, tested, tests, test_file_path, file_path, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | example | tested | tests | test_file_path | file_path | params | output | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| build_wasm_cpp_app | function | bash | infra | 0.1.0 | impure | build_wasm_cpp_app(app_name: string, [--no-budget-check]) -> void | Compila una app C++ del registry (cpp/apps/<name>) a WASM via emscripten. Sale build/wasm/<name>/<name>.{html,js,wasm,wasm.gz}. Falla si gzip > 2 MB. |
|
false | error_go_core | bash bash/functions/infra/build_wasm_cpp_app.sh engine_smoke | false | bash/functions/infra/build_wasm_cpp_app.sh |
|
Reporte de tamaños en stdout. Crea build/wasm/<app>/<app>.html/.js/.wasm/.wasm.gz. Exit 3 si excede budget hard. |
build_wasm_cpp_app
Compila apps C++ del registry a WebAssembly. Issue 0072d (parte del stack gamedev).
Requisitos
emsdkinstalado y activo en el shell, o presente en<repo>/emsdk/(autoactiva).cpp/apps/<app>/CMakeLists.txtcon bloqueif(EMSCRIPTEN) ... endif()que define los flags wasm (USE_WEBGL2, FULL_ES3, ALLOW_MEMORY_GROWTH, etc.).cpp/CMakeLists.txtdebe seguir tolerando configuracion viaemcmake. La app target se elige concmake --build $BUILD_DIR --target <app>.
Flujo
- Localiza
emccen PATH o autoactiva<repo>/emsdk/emsdk_env.sh. emcmake cmake -S cpp -B build/wasm/<app> -DCMAKE_BUILD_TYPE=MinSizeRelcmake --build build/wasm/<app> --target <app> -jgzip -9 -k <app>.wasmybrotli -q 11 -k <app>.wasm(si brotli disponible).- Reporta tamaños y compara contra budget (1.5 MB gzip soft, 2 MB hard).
Budgets
| Limite | Valor | Comportamiento |
|---|---|---|
| Soft | 1.5 MB gzip | Warning, sigue |
| Hard | 2 MB gzip | Exit 3, falla |
Skip con --no-budget-check.
Apps soportadas
Cualquier app bajo cpp/apps/<name>/ cuyo CMakeLists.txt defina target con flags emscripten. Probada con: engine_smoke (issue 0072a).
Errores comunes
emcc no encontrado→ instalar emsdk segun instrucciones del propio script.<app>.wasm no encontrado→ fallo de build. Re-ejecutar con2>&1 | teepara ver compiler errors.wasm.gz excede budget→ revisar bloat, usartwiggy topowasm-objdump -h. Ver issue 0072d.