# Build Instructions ## Quick Start ```bash # Development build cmake -S . -B build cmake --build build -j4 # Size-optimized build cmake -S . -B build -DDEMO_SIZE_OPT=ON cmake --build build -j4 # Final stripped build cmake -S . -B build_final -DDEMO_FINAL_STRIP=ON cmake --build build_final -j4 ``` ## Build Modes | Mode | Flags | Use Case | |------|-------|----------| | Debug | `-DCMAKE_BUILD_TYPE=Debug` | Development, full error checking + debug features | | STRIP_ALL | `-DDEMO_STRIP_ALL=ON` | Release candidate, full error checking, no debug features (~64k target) | | FINAL_STRIP | `-DDEMO_FINAL_STRIP=ON` | Final release, no error checking, absolute minimum size | ## Dependencies Install via Homebrew (macOS): ```bash brew install wgpu-native ``` Or use project init script: ```bash ./scripts/project_init.sh ``` Required libraries: - **miniaudio** (single header, auto-fetched by init script) - **wgpu-native** (WebGPU implementation) - **glfw3webgpu** (GLFW surface helper, auto-fetched) - **UPX** (executable packer, optional for Linux/Windows) ## Windows Cross-Compilation (macOS) Requires `mingw-w64` and `wine-stable`. ```bash # Fetch Windows dependencies ./scripts/fetch_win_deps.sh # Build for Windows ./scripts/build_win.sh # Test with Wine ./scripts/run_win.sh ``` Produces `build_win/demo64k_packed.exe`. ## Xcode Build (macOS) ```bash cmake -S . -B build -G "Xcode" open build/demo.xcodeproj ``` Use Xcode Metal debugger for shader performance analysis.