-
Notifications
You must be signed in to change notification settings - Fork 167
MacOS compatibility #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
MacOS compatibility #345
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,11 @@ | |
|
|
||
| #include <stdbool.h> | ||
|
|
||
| #ifdef __APPLE__ | ||
| #include <stdlib.h> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably include |
||
| #else | ||
| #include <malloc.h> | ||
| #endif | ||
| #include "cnmatrix/cn_flt.h" | ||
| #include "math.h" | ||
| #include "string.h" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,12 @@ if(USE_HIDAPI) | |
| add_definitions (-DHIDAPI) | ||
| IF(WIN32) | ||
| SET(SURVIVE_SRCS ${SURVIVE_SRCS} ../redist/hid-windows.c) | ||
| elseif(APPLE) | ||
| find_library(HIDAPI_LIBRARY hidapi PATHS /opt/homebrew/lib /usr/local/lib) | ||
| if(HIDAPI_LIBRARY) | ||
| list(APPEND ADDITIONAL_LIBRARIES ${HIDAPI_LIBRARY}) | ||
| include_directories(/opt/homebrew/include /usr/local/include) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm that seems a bit too wide, there's no target available from CMake ? |
||
| endif() | ||
| else() | ||
| list(APPEND ADDITIONAL_LIBRARIES udev hidapi-libusb) | ||
| endif() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,6 +218,7 @@ void error_fn(void *user, const struct CnMat *x0, const struct CnMat *x1, struct | |
| } | ||
| } | ||
| void survive_kalman_lighthouse_ootx(SurviveKalmanLighthouse *tracker) { | ||
| if (tracker == NULL) return; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it often |
||
| tracker->state.BSD0 = tracker->ctx->bsd[tracker->lh].fcal[0]; | ||
| tracker->state.BSD1 = tracker->ctx->bsd[tracker->lh].fcal[1]; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not commented out?