Skip to content

Commit e2006d4

Browse files
committed
fix setup-cross-compilation.sh
- Updated the script to use a more concise syntax for exporting environment variables. - Improved readability by using echo and conditional checks for BINDGEN_EXTRA_CLANG_ARGS. - This change simplifies the script while maintaining functionality.
1 parent 9cc55d3 commit e2006d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/setup-cross-compilation.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ mkdir -p /tmp/sqlpage-libs
3434
cp "$LIBDIR/libgcc_s.so.1" /tmp/sqlpage-libs/
3535
rustup target add "$TARGET"
3636

37-
cat > /tmp/build-env.sh <<EOF
38-
export TARGET="$TARGET"
39-
export LINKER="$LINKER"
40-
${BINDGEN_EXTRA_CLANG_ARGS:+export BINDGEN_EXTRA_CLANG_ARGS="$BINDGEN_EXTRA_CLANG_ARGS"}
41-
EOF
37+
{
38+
echo "export TARGET='$TARGET'"
39+
echo "export LINKER='$LINKER'"
40+
[ -n "$BINDGEN_EXTRA_CLANG_ARGS" ] && printf "export BINDGEN_EXTRA_CLANG_ARGS=%q\n" "$BINDGEN_EXTRA_CLANG_ARGS"
41+
} > /tmp/build-env.sh

0 commit comments

Comments
 (0)