@@ -42,9 +42,37 @@ issue, provide us with:
42
42
43
43
## Building
44
44
45
- Build instructions are in the [ README ] ( ./README.md ) .
45
+ To build ` libbindgen ` :
46
46
47
- Additionally, you may want to build and test with the ` _docs ` feature to ensure
47
+ ```
48
+ $ cd bindgen/libbindgen
49
+ $ cargo build
50
+ ```
51
+
52
+ To build the ` bindgen ` executable:
53
+
54
+ ```
55
+ $ cd bindgen/bindgen
56
+ $ cargo build
57
+ ```
58
+
59
+ If you installed multiple versions of llvm, it may not be able to locate the
60
+ latest version of libclang. In that case, you may want to either uninstall other
61
+ versions of llvm, or specify the path of the desired libclang explicitly:
62
+
63
+ ```
64
+ $ export LIBCLANG_PATH=path/to/clang-3.9/lib
65
+ ```
66
+
67
+ On Linux and macOS, you may also need to add a path to ` libclang.so ` (usually
68
+ the same path as above) to library search path. This can be done as below:
69
+
70
+ ```
71
+ $ export LD_LIBRARY_PATH=path/to/clang-3.9/lib # for Linux
72
+ $ export DYLD_LIBRARY_PATH=path/to/clang-3.9/lib # for macOS
73
+ ```
74
+
75
+ Additionally, you may want to build and test with the ` docs_ ` feature to ensure
48
76
that you aren't forgetting to document types and functions. CI will catch it if
49
77
you forget, but the turn around will be a lot slower ;)
50
78
@@ -59,10 +87,11 @@ The following sections assume you are working in that subdirectory.
59
87
60
88
### Overview
61
89
62
- Input C/C++ test headers reside in the ` tests/headers ` directory. Expected
63
- output Rust bindings live in ` tests/expectations/tests ` . For example,
64
- ` tests/headers/my_header.h ` 's expected generated Rust bindings would be
65
- ` tests/expectations/tests/my_header.rs ` .
90
+ Input C/C++ test headers reside in the ` libbindgen/tests/headers `
91
+ directory. Expected output Rust bindings live in
92
+ ` libbindgen/tests/expectations/tests ` . For example,
93
+ ` libbindgen/tests/headers/my_header.h ` 's expected generated Rust bindings would
94
+ be ` libbindgen/tests/expectations/tests/my_header.rs ` .
66
95
67
96
Run ` cargo test ` to compare generated Rust bindings to the expectations.
68
97
@@ -115,7 +144,7 @@ And ensure `~/.cargo/bin` is on your path.
115
144
## Debug Logging
116
145
117
146
To help debug what ` bindgen ` is doing, you can define the environment variable
118
- ` RUST_LOG=bindgen ` to get a bunch of debugging log spew.
147
+ ` RUST_LOG=libbindgen ` to get a bunch of debugging log spew.
119
148
120
149
```
121
150
$ RUST_LOG=libbindgen ./target/debug/bindgen [flags...] ~/path/to/some/header.h
@@ -124,7 +153,8 @@ $ RUST_LOG=libbindgen ./target/debug/bindgen [flags...] ~/path/to/some/header.h
124
153
This logging can also be used when debugging failing tests:
125
154
126
155
```
127
- $ RUST_LOG=libbindgen cd libbindgen && cargo test
156
+ $ cd libbindgen
157
+ $ RUST_LOG=libbindgen cargo test
128
158
```
129
159
130
160
## Using ` creduce ` to Minimize Test Cases
0 commit comments