Fix headers with directories

This commit is contained in:
Jeremy Soller
2018-08-26 12:40:19 -06:00
parent 124e118f9f
commit 6418f893e4
+8 -4
View File
@@ -9,8 +9,12 @@ for config in src/header/*/cbindgen.toml
do
dir="$(dirname "$config")"
name="$(basename "$dir")"
pushd "$dir"
cargo run --release --manifest-path "$cbindgen/Cargo.toml" -- \
-c cbindgen.toml -o "$include/$name.h" mod.rs
popd
if [ "${name:0:1}" != "_" ]
then
header="$include/${name/_/\/}.h"
pushd "$dir"
cargo run --release --manifest-path "$cbindgen/Cargo.toml" -- \
-c cbindgen.toml -o "$header" mod.rs
popd
fi
done