Skip to content

Commit be1a741

Browse files
committed
Add script for regenerating binding files
Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
1 parent 83726ed commit be1a741

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2022 Contributors to the Parsec project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
set -xeuf -o pipefail
7+
8+
targets="aarch64-unknown-linux-gnu arm-unknown-linux-gnueabi i686-unknown-linux-gnu powerpc64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-apple-darwin aarch64-apple-darwin"
9+
TARGET_INSTALLED=
10+
11+
for target in $targets; do
12+
13+
# Check if the target is already installed
14+
if ! rustup target list | grep -q "$target (installed)"; then
15+
rustup target install $target
16+
TARGET_INSTALLED="$target"
17+
fi
18+
19+
cargo build --target $target --features generate-bindings
20+
find ../target/$target/ -name pkcs11_bindings.rs | xargs -I '{}' cp '{}' src/bindings/$target.rs
21+
22+
if [ "$TARGET_INSTALLED" == "$target" ]; then
23+
rustup target remove $target
24+
fi
25+
done

0 commit comments

Comments
 (0)