8
8
* [ FreeBSD] ( #freebsd )
9
9
* [ Mac] ( #mac )
10
10
* [ Windows] ( #windows )
11
- * [ Integrating hidapi directly into your source tree] ( #integrating -hidapi-directly-into-your-source-tree )
11
+ * [ Embedding HIDAPI directly into your source tree] ( #embedding -hidapi-directly-into-your-source-tree )
12
12
* [ Building the manual way on Unix platforms] ( #building-the-manual-way-on-unix-platforms )
13
13
* [ Building on Windows] ( #building-on-windows )
14
14
@@ -68,19 +68,30 @@ On Mac make sure you have XCode installed and its Command Line Tools.
68
68
On Windows you just need a compiler. You may use Visual Studio or Cygwin/MinGW,
69
69
depending on which environment is best for your needs.
70
70
71
- ## Integrating HIDAPI directly into your source tree
71
+ ## Embedding HIDAPI directly into your source tree
72
72
73
- Instead of using one of the provided build systems, you may want to integrate
74
- HIDAPI directly into your source tree.
75
- Generally it is not encouraged to do so, but if you must, all you need to do:
76
- - add a single source file ` hid.c ` (for a specific backend);
77
- - setup include directory to ` <HIDAPI repo root>/hidapi ` ;
78
- - add link libraries, that are specific for each backend.
73
+ Instead of using one of the provided standalone build systems,
74
+ you may want to integrate HIDAPI directly into your source tree.
79
75
80
- Check the manual makefiles for a simple example/reference of what are the dependencies of each specific backend.
76
+ ---
77
+ If your project uses CMake as a build system, it is safe to add HIDAPI as a [ subdirectory] ( BUILD.cmake.md#hidapi-as-a-subdirectory ) .
78
+
79
+ ---
80
+ If _ the only option_ that works for you is adding HIDAPI sources directly
81
+ to your project's build system, then you need:
82
+ - include a _ single source file_ into your project's build system,
83
+ depending on your platform and the backend you want to use:
84
+ - [ ` windows\hid.c ` ] ( windows/hid.c ) ;
85
+ - [ ` linux/hid.c ` ] ( linux/hid.c ) ;
86
+ - [ ` libusb/hid.c ` ] ( libusb/hid.c ) ;
87
+ - [ ` mac/hid.c ` ] ( mac/hid.c ) ;
88
+ - add a [ ` hidapi ` ] ( hidapi ) folder to the include path when building ` hid.c ` ;
89
+ - make the platform/backend specific [ dependencies] ( #prerequisites ) available during the compilation/linking, when building ` hid.c ` ;
81
90
82
- NOTE: if your have a CMake-based project, you're likely be able to use
83
- HIDAPI directly as a subdirectory. Check [ BUILD.cmake.md] ( BUILD.cmake.md ) for details.
91
+ NOTE: the above doesn't guarantee that having a copy of ` <backend>/hid.c ` and ` hidapi/hidapi.h ` is enough to build HIDAPI.
92
+ The only guarantee that ` <backend>/hid.c ` includes all nesessary sources to compile it as a single file.
93
+
94
+ Check the manual makefiles for a simple example/reference of what are the dependencies of each specific backend.
84
95
85
96
## Building the manual way on Unix platforms
86
97
@@ -106,5 +117,5 @@ To build HIDAPI using MinGW or Cygwin using Autotools, use a general Autotools
106
117
107
118
Any windows builds (MSVC or MinGW/Cygwin) are also supported by [ CMake] ( BUILD.cmake.md ) .
108
119
109
- If you are looking for information regarding DDK build of HIDAPI
120
+ If you are looking for information regarding DDK build of HIDAPI:
110
121
- the build has been broken for a while and now the support files are obsolete.
0 commit comments