build(cmake): clean up presets, add release/apple presets, cross-platform triplets
Rationalize the preset set to match the project's actual state (past M5): - Rename dev->skeleton (no-deps stub smoke), m1-dev->dev (default dev preset) - Drop m2-dev (cache-identical to m1-dev) - Add release preset (optimized + tests on, symbols kept) - Strip server-release binaries (-s linker flag) - Add apple-dev/apple-ios/apple-ios-sim scaffolding presets for XCFramework Add cmake/voicecat-toolchain.cmake wrapper that auto-resolves the vcpkg triplet from the host platform (x64-mingw-static/x64-linux/arm64-osx) so the main presets work on Windows/Linux/macOS without per-OS variants. Update all docs (building.md, CLAUDE.md, README.md, AGENTS.md, deployment.md, tech-stack.md, client READMEs) and stale preset-name references in code comments. No C++ behavior changes — the core was already portable.
This commit is contained in:
38
CLAUDE.md
38
CLAUDE.md
@@ -4,11 +4,10 @@ Auto-loaded each session. This is the **map**: build commands, architecture at a
|
||||
where everything is. For the *working method* read [`AGENTS.md`](AGENTS.md); for *what's done
|
||||
and what's next* read [`PROGRESS.md`](PROGRESS.md); for *design* read [`docs/`](docs/).
|
||||
|
||||
> **One-line status:** M4 (Windows WinForms C# client) is complete — connect, saved servers,
|
||||
> TOFU identity pinning, channel tree, voice (VAD/PTT/always-on + VAD threshold slider +
|
||||
> per-user tuning), text chat, device pickers, level meters. `ctest --preset m1-dev` green —
|
||||
> 14/14 tests. `dotnet build` green — 0 warnings. macOS/iOS Swift client and M5 (moderation)
|
||||
> are next. See [`PROGRESS.md`](PROGRESS.md).
|
||||
> **One-line status:** M5 (moderation & admin UI) is complete — permissions, kick/ban/move,
|
||||
> server-mute, channel CRUD, in-app account management, disconnect/keepalive/reaper. Windows
|
||||
> WinForms C# client is shipped (M4). `ctest --preset dev` green — 21/21 tests. macOS/iOS
|
||||
> Swift client is next. See [`PROGRESS.md`](PROGRESS.md).
|
||||
|
||||
VoiceCat = self-hosted native voice & text chat (TeamSpeak/Mumble-style). Plain TCP (control)
|
||||
+ UDP (media), no WebRTC, encrypted by default. A shared C++ core (`libvoicecat`) drives
|
||||
@@ -18,15 +17,16 @@ native clients (Swift on macOS/iOS, C# on Windows) and the server.
|
||||
|
||||
## Build & test commands
|
||||
|
||||
The **M0 skeleton builds with no third-party dependencies** — just CMake + Ninja + a C++20
|
||||
compiler. Deps (vcpkg) are off until a subsystem needs them.
|
||||
The default development preset is **`dev`** — it builds everything (server + tools + tests)
|
||||
with real vcpkg deps. The `skeleton` preset (no deps, stubs only) is a fast smoke check; see
|
||||
[`docs/building.md`](docs/building.md) for the full preset matrix.
|
||||
|
||||
```bash
|
||||
# Configure + build the skeleton (default; no vcpkg needed)
|
||||
# Configure + build (default development preset; needs VCPKG_ROOT)
|
||||
cmake --preset dev
|
||||
cmake --build --preset dev
|
||||
|
||||
# Run the tests (behavior smoke test today; grows per milestone)
|
||||
# Run the tests (21 behavior tests — grows per milestone)
|
||||
ctest --preset dev # or: ctest --test-dir build/dev --output-on-failure
|
||||
|
||||
# Run the binaries (Windows adds .exe; Linux/macOS no extension)
|
||||
@@ -43,14 +43,26 @@ rm -rf build/dev # nuke; or:
|
||||
cmake --build --preset dev --target clean
|
||||
```
|
||||
|
||||
When you start a subsystem that needs real libraries (mbedTLS, libsodium, opus, protobuf, …),
|
||||
turn vcpkg deps on:
|
||||
Other presets (see [`docs/building.md`](docs/building.md) for full detail):
|
||||
|
||||
```bash
|
||||
cmake --preset skeleton # no-deps stub smoke (no VCPKG_ROOT needed) — 2 tests
|
||||
cmake --preset release # optimized + tests on, symbols kept (profile/debug-friendly)
|
||||
cmake --preset server-release # optimized + stripped, no tests (deployment-shaped)
|
||||
cmake --preset windows-client # voicecat.dll for the C# WinForms client (Windows only)
|
||||
cmake --preset apple-dev # libvoicecat.a for macOS Swift Package (scaffolding, macOS only)
|
||||
```
|
||||
|
||||
Vcpkg triplet is auto-resolved from the host platform by
|
||||
[`cmake/voicecat-toolchain.cmake`](cmake/voicecat-toolchain.cmake) — `x64-mingw-static` on
|
||||
Windows, `x64-linux` on Linux, `arm64-osx` on Apple Silicon. See docs/building.md §1
|
||||
"Platform matrix" for details.
|
||||
|
||||
One-time vcpkg setup:
|
||||
|
||||
```bash
|
||||
# one-time: git clone https://github.com/microsoft/vcpkg && ./vcpkg/bootstrap-vcpkg.sh (.bat on Windows)
|
||||
export VCPKG_ROOT=/path/to/vcpkg # works on Linux / macOS / Windows
|
||||
cmake --preset server-release # auto-installs deps pinned in vcpkg.json
|
||||
cmake --build --preset server-release
|
||||
```
|
||||
|
||||
Other useful toggles (pass with `-D` at configure time):
|
||||
|
||||
Reference in New Issue
Block a user