chore: scaffold CMake build system

Add the CMake build for the Swift + C++ macOS port, mirroring the
refix layout: deps/ modules (Platform, Flags, Sanitizers, FindUnity),
per-module static libraries (usb, auth, mt76, gip, hid, api), a Swift
app entry point with a pure C bridge header, and a Unity test suite
behind BUILD_TESTING.

Swift requires the Ninja or Xcode generator; a guard in
CMakeLists.txt rejects anything else.

Co-Authored-By: qwen (qwen/qwen3.8-27b@q2_k_xl): scaffolded CMake build + tests
This commit is contained in:
portersky
2026-08-17 14:18:03 +02:00
parent 78f042ab84
commit a7d7d0f253
25 changed files with 742 additions and 0 deletions
+22
View File
@@ -7,6 +7,28 @@ See [PLAN.md](PLAN.md) for full architecture and implementation phases.
---
## Building
Requires CMake ≥ 3.21, Xcode (or Command Line Tools), and Ninja.
Swift is only supported by the **Ninja** and **Xcode** generators in CMake,
so configure with one of them explicitly:
```sh
cmake -S . -B build -G Ninja -DBUILD_TESTING=ON
cmake --build build
./build/xone_app
cmake --build build --target check # run the test suite
```
Layout (mirrors `../refix/`):
- `deps/` — CMake modules: `Platform.cmake`, `Flags.cmake`, `Sanitizers.cmake`, `FindUnity.cmake`
- `src/{usb,mt76,gip,auth,hid}` — C++ protocol stack (ported from `medusalix/xone`)
- `src/app/` — Swift app entry point + C ABI bridge (`include/app/xone_api.h`)
- `tests/` — Unity test suite (`BUILD_TESTING=ON`)
---
## Investigation Checklist
These items need research on macOS before implementation can begin.