Skip to content

Commit 257d491

Browse files
Add script to call bindgen
1 parent 9d7c2cc commit 257d491

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tensorflow-sys/generate_bindgen_rs.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
if ! which bindgen &> /dev/null; then
4+
echo "ERROR: Please install 'bindgen' using cargo:"
5+
echo " cargo install bindgen"
6+
echo "See https://github.com/servo/rust-bindgen for more information."
7+
exit 1
8+
fi
9+
10+
# See https://github.com/servo/rust-bindgen/issues/550 as to why
11+
# this is blacklisted.
12+
bindgen_options="--blacklist-type max_align_t"
13+
header="/usr/include/tensorflow/c_api.h"
14+
15+
cmd="bindgen ${bindgen_options} ${header} --output src/bindgen.rs"
16+
echo ${cmd}
17+
${cmd}

0 commit comments

Comments
 (0)