Skip to content

Commit

Permalink
general: Allow building on FreeBSD
Browse files Browse the repository at this point in the history
* Tested on NomadBSD 13.2-RELEASE
* Use normal hidapi (without hidraw) which works with CMSIS-DAP
  • Loading branch information
ALTracer committed Dec 9, 2023
1 parent 54b8061 commit 3e2a99a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/include/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#include <malloc.h>
#else
/* `alloca()` on FreeBSD is visible from <stdlib.h>, and <alloca.h> does not exist */
#elif !defined(__FreeBSD__)
#include <alloca.h>
#endif
#include <stdint.h>
Expand Down
4 changes: 4 additions & 0 deletions src/platforms/hosted/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ HIDAPILIB = hidapi
ifneq (,$(findstring linux,$(SYS)))
SRC += serial_unix.c
HIDAPILIB = hidapi-hidraw
else ifneq (,$(findstring freebsd,$(SYS)))
# On FreeBSD, only the hidapi on libusb-1.0 variant exists
SRC += serial_unix.c
HIDAPILIB = hidapi
else ifneq (,$(findstring mingw,$(SYS)))
FLAVOUR = $(shell which $(CC))
ifneq (,$(findstring ucrt64,$(FLAVOUR)))
Expand Down

0 comments on commit 3e2a99a

Please sign in to comment.