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:
@@ -0,0 +1,19 @@
|
||||
// C ABI bridge between the C++ protocol stack and the Swift app layer.
|
||||
|
||||
#include "app/xone_api.h"
|
||||
|
||||
#include "usb/usb_transport.hpp"
|
||||
|
||||
#ifndef XONE_VERSION
|
||||
#define XONE_VERSION "0.1.0"
|
||||
#endif
|
||||
|
||||
extern "C" const char *xone_version(void)
|
||||
{
|
||||
return XONE_VERSION;
|
||||
}
|
||||
|
||||
extern "C" bool xone_dongle_present(void)
|
||||
{
|
||||
return xone::usb::probe();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// xone_macos — macOS app entry point (Swift)
|
||||
// TODO(phase 5): device discovery, pairing UI, status display, menubar icon.
|
||||
|
||||
import Foundation
|
||||
|
||||
let version = String(cString: xone_version())
|
||||
print("xone_macos \(version)")
|
||||
|
||||
if xone_dongle_present() {
|
||||
print("Xbox Wireless Dongle detected")
|
||||
} else {
|
||||
print("No Xbox Wireless Dongle detected (plug in the dongle and retry)")
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Auth + crypto
|
||||
// TODO(phase 1): port from medusalix/xone auth/auth.c + auth/crypto.c.
|
||||
|
||||
#include "auth/crypto.hpp"
|
||||
|
||||
namespace xone::auth {
|
||||
} // namespace xone::auth
|
||||
@@ -0,0 +1,7 @@
|
||||
// GIP protocol (Game Input Protocol)
|
||||
// TODO(phase 1): port from medusalix/xone bus/protocol.c + bus/bus.c.
|
||||
|
||||
#include "gip/protocol.hpp"
|
||||
|
||||
namespace xone::gip {
|
||||
} // namespace xone::gip
|
||||
@@ -0,0 +1,7 @@
|
||||
// Virtual HID gamepad presentation
|
||||
// TODO(phase 4): DriverKit IOHIDDriver implementation.
|
||||
|
||||
#include "hid/hid_device.hpp"
|
||||
|
||||
namespace xone::hid {
|
||||
} // namespace xone::hid
|
||||
@@ -0,0 +1,16 @@
|
||||
// MT76 chip protocol (MediaTek MT76xx radio in the dongle)
|
||||
// TODO(phase 3): port from medusalix/xone transport/mt76.c.
|
||||
|
||||
#include "mt76/mt76.hpp"
|
||||
|
||||
namespace xone::mt76 {
|
||||
|
||||
auto load_firmware(std::uint16_t pid, char const *firmware_path) -> bool
|
||||
{
|
||||
(void)pid;
|
||||
(void)firmware_path;
|
||||
// Not implemented yet: no USB transport in place.
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace xone::mt76
|
||||
@@ -0,0 +1,14 @@
|
||||
// USB transport (IOKit / IOUSBFamily)
|
||||
// TODO(phase 2): port from medusalix/xone transport/dongle.c + mt76.c USB calls.
|
||||
|
||||
#include "usb/usb_transport.hpp"
|
||||
|
||||
namespace xone::usb {
|
||||
|
||||
auto probe() -> bool
|
||||
{
|
||||
// Not implemented yet: no IOKit device matching in place.
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace xone::usb
|
||||
Reference in New Issue
Block a user