|
1 | 1 | #!/bin/sh
|
2 | 2 | set -e
|
3 | 3 |
|
| 4 | +function compile() { |
| 5 | + local triple=$1 |
| 6 | + local suffix=$2 |
| 7 | + |
| 8 | + cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target $triple |
| 9 | + cargo build -p powersync_static -Z build-std=panic_abort,core,alloc --release --target $triple |
| 10 | + |
| 11 | + mv "target/$triple/release/libpowersync.so" "libpowersync_$suffix.so" |
| 12 | + mv "target/$triple/release/libpowersync.a" "libpowersync_$suffix.linux.a" |
| 13 | +} |
| 14 | + |
4 | 15 | case "$1" in
|
5 | 16 | x64)
|
6 |
| - cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target x86_64-unknown-linux-gnu |
7 |
| - mv "target/x86_64-unknown-linux-gnu/release/libpowersync.so" "libpowersync_x64.so" |
| 17 | + compile x86_64-unknown-linux-gnu x64 |
8 | 18 | ;;
|
9 | 19 | x86)
|
10 |
| - cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target i686-unknown-linux-gnu |
11 |
| - mv "target/i686-unknown-linux-gnu/release/libpowersync.so" "libpowersync_x86.so" |
| 20 | + compile i686-unknown-linux-gnu x86 |
12 | 21 | ;;
|
13 | 22 | aarch64)
|
14 |
| - cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target aarch64-unknown-linux-gnu |
15 |
| - mv "target/aarch64-unknown-linux-gnu/release/libpowersync.so" "libpowersync_aarch64.so" |
| 23 | + compile aarch64-unknown-linux-gnu aarch64 |
16 | 24 | ;;
|
17 | 25 | armv7)
|
18 |
| - cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target armv7-unknown-linux-gnueabihf |
19 |
| - mv "target/armv7-unknown-linux-gnueabihf/release/libpowersync.so" "libpowersync_armv7.so" |
| 26 | + compile armv7-unknown-linux-gnueabihf armv7 |
20 | 27 | ;;
|
21 | 28 | riscv64gc)
|
22 |
| - cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --release --target riscv64gc-unknown-linux-gnu |
23 |
| - mv "target/riscv64gc-unknown-linux-gnu/release/libpowersync.so" "libpowersync_riscv64gc.so" |
| 29 | + compile riscv64gc-unknown-linux-gnu riscv64gc |
24 | 30 | ;;
|
25 | 31 | *)
|
26 | 32 | echo "Unknown architecture"
|
|
0 commit comments