Enable macOS build for the face-auth path#191
Open
marinmarian wants to merge 1 commit into
Open
Conversation
The face-auth path (FaceAuthenticator, DeviceController, FwUpdater)
is platform-agnostic apart from the serial transport. The existing
LinuxSerial implementation uses only POSIX APIs (termios.h /
unistd.h / fcntl.h), so it builds and runs on macOS unchanged.
Changes:
- cmake/OS.cmake: add an APPLE branch matching the existing ANDROID
style (no platform-specific defines needed).
- src/PacketManager/CMakeLists.txt: include LinuxSerial on APPLE too,
with a comment explaining why the same source is reused.
- Four platform guards extended from '#elif defined(__linux__)' to
'#elif defined(__linux__) || defined(__APPLE__)' so the LinuxSerial
header is selected on macOS:
src/DeviceController/DeviceControllerImpl.cc
src/FaceAuthenticator/Impl/FaceAuthenticatorCommon.cc
src/FwUpdate/F45x/FwUpdaterCommF45x.cc
src/FwUpdate/F50x/FwUpdaterCommF50x.cc
- Readme.md: add macOS to the Platforms list and a macOS Notes
subsection documenting the build flag (RSID_PREVIEW=OFF) and the
discover_devices() limitation.
Out of scope (separate PRs welcome):
- Preview / libuvc support on macOS (libuvc is excluded for Apple
upstream; AVFoundation would be the macOS-native replacement).
- IOKit-based discover_devices() so applications can enumerate
devices without hardcoding the serial port path.
Tested on Apple Silicon (M-series, macOS 26, Apple Clang 21,
Python 3.13) with an F455 over USB. Build:
cmake -DRSID_PY=ON -DRSID_PREVIEW=OFF \
-DRSID_SAMPLES=OFF -DRSID_TOOLS=OFF ..
make
End-to-end face-auth verified: enroll, identify, query users, remove.
F500 firmware update guard updated to match but not runtime-tested
(no F500 hardware on hand).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables building the face-auth path of the RealSense ID SDK on macOS (Apple Silicon). The existing
LinuxSerialimplementation is pure POSIX, so the same serial transport works unchanged on macOS — the patch just opts macOS into the existing code paths viaAPPLE(CMake) and__APPLE__(preprocessor).What's included
cmake/OS.cmake: newAPPLEbranch matching the existingANDROIDstyle.src/PacketManager/CMakeLists.txt: includeLinuxSerialon macOS, with a comment explaining why reuse is safe.__APPLE__:DeviceControllerImpl.ccFaceAuthenticatorCommon.ccFwUpdaterCommF45x.ccFwUpdaterCommF50x.ccReadme.md: macOS added to Platforms list + macOS Notes subsection.~10 lines of code across 6 files.
Out of scope (happy to follow up)
libuvcsupport on macOS —libuvcis already excluded for Apple upstream. AVFoundation would be the macOS-native replacement.discover_devices()— the function currently walks/sys/bus/usb/and returns an empty list on macOS. Documented as a known limitation in the macOS Notes.Tested
-DRSID_PY=ON -DRSID_PREVIEW=OFF.