blob: 1f651227b4388bdd7e2412cdb84f18e17bfe1e1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# 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.
|