@@ -14,12 +14,14 @@ the unsafe C bindings.
14
14
## Usage
15
15
Simply add this crate as a dependency in your ` Cargo.toml ` .
16
16
The static library is distributed in this crate with permission from FTDI.
17
+ The default feature set will use dynamic linking.
17
18
18
19
``` toml
19
20
[dependencies ]
20
21
libftd2xx-ffi = " ~0.5.1"
21
22
```
22
23
24
+ ### Bindgen
23
25
The default feature set will use pre-generated bindings.
24
26
This is only available for Windows x86_64 and Linux x86_64 platforms.
25
27
@@ -33,28 +35,49 @@ libftd2xx-ffi = { version = "~0.5.1", features = ["bindgen"] }
33
35
Bindgen has additional dependencies that must be installed in order to
34
36
compile successfully, see the [ bindgen requirements] page for more details.
35
37
38
+ ### Static Linking
39
+ Static linking the FTD2XX library into this crate can be done by using
40
+ the [ "static"] feature flag.
41
+ ``` toml
42
+ [dependencies ]
43
+ libftd2xx-ffi = { version = " ~0.5.1" , features = [" static" ] }
44
+ ```
45
+ For GNU/Linux users, no further work is needed. Technically this may be preferred.
46
+ However there may be license incompatibilities (static linking with GPL code).
47
+ If in doubt, check the FTDI driver license terms.
48
+
49
+ On Windows, we rely on MSVC and a manually set the "LIBMSVC_PATH" environment variable.
50
+ For example a possible 2019 Community installation path may be:
51
+ ```
52
+ C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\
53
+ ```
54
+ This brings in legacy_stdio_definitions.lib and user32.lib. It seems to play nicely with rust,
55
+ but you may end up with multiple defined symbol errors if using this crate as a c/c++ dependency.
56
+
36
57
## Supported Targets
37
58
38
59
### Tested Targets
39
60
40
- * ` x86_64-pc-windows-msvc ` (dynamic linking only)
41
- * ` x86_64-unknown-linux-gnu ` (static linking only)
42
- * ` x86_64-unknown-linux-musl ` (static linking only)
61
+ * ` i686-pc-windows-msvc ` (dynamic + static)
62
+ * ` i686-unknown-linux-gnu ` (dynamic + static)
63
+ * ` i686-unknown-linux-musl ` (static)
64
+ * ` x86_64-pc-windows-msvc ` (dynamic + static)
65
+ * ` x86_64-unknown-linux-gnu ` (dynamic + static)
66
+ * ` x86_64-unknown-linux-musl ` (static)
43
67
44
68
### Untested Targets
45
69
46
70
These targets are provided, but they are untested.
47
71
Use at your own risk.
48
72
49
- * ` aarch64-unknown-linux-gnu ` (static linking only)
50
- * ` aarch64-unknown-linux-musl ` (static linking only)
51
- * ` arm-unknown-linux-gnueabihf ` (static linking only)
52
- * ` arm-unknown-linux-musleabihf ` (static linking only)
53
- * ` armv7-unknown-linux-gnueabihf ` (static linking only)
54
- * ` armv7-unknown-linux-musleabihf ` (static linking only)
55
- * ` i686-pc-windows-msvc ` (dynamic linking only)
56
- * ` i686-unknown-linux-gnu ` (static linking only)
57
- * ` i686-unknown-linux-musl ` (static linking only)
73
+ * ` aarch64-unknown-linux-gnu ` (dynamic + static)
74
+ * ` aarch64-unknown-linux-musl ` (dynamic + static)
75
+ * ` arm-unknown-linux-gnueabihf ` (dynamic + static)
76
+ * ` arm-unknown-linux-musleabihf ` (dynamic + static)
77
+ * ` armv7-unknown-linux-gnueabihf ` (dynamic + static)
78
+ * ` armv7-unknown-linux-musleabihf ` (dynamic + static)
79
+ * ` i686-unknown-linux-musl ` (dynamic)
80
+ * ` x86_64-unknown-linux-musl ` (dynamic)
58
81
59
82
## References
60
83
0 commit comments