-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·54 lines (41 loc) · 2.21 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
VERSION="v0.0.4"
rm -r build
mkdir build
## CLI tool
# Binaries are automatically stripped (set in build.zig)
# Build bkg for x86_64-linux
echo "Building bkg CLI for x86_64-linux..."
zig build -Drelease-fast -Dtarget=x86_64-linux-gnu
mv zig-out/bin/bkg build/bkg-x86_64-linux
# Build bkg for aarch64-linux
echo "Building bkg CLI for aarch64-linux..."
zig build -Drelease-fast -Dtarget=aarch64-linux-gnu
mv zig-out/bin/bkg build/bkg-aarch64-linux
# Build bkg for x86_64-macos
echo "Building bkg CLI for x86_64-macos..."
zig build -Drelease-fast -Dtarget=x86_64-macos
mv zig-out/bin/bkg build/bkg-x86_64-macos
# Build bkg for aarch64-macos
echo "Building bkg CLI for aarch64-macos..."
zig build -Drelease-fast -Dtarget=aarch64-macos
mv zig-out/bin/bkg build/bkg-aarch64-macos
## Runtime
# Binaries are stripped with --strip flag
# Build bkg_runtime for x86_64-linux
echo "Building bkg runtime for x86_64-linux..."
zig build-exe -target x86_64-linux-gnu -Drelease-fast src/bkg_runtime.zig -fstrip -lc deps/lz4/lib/lz4.c deps/microtar/src/microtar.c --pkg-begin known-folders deps/known-folders/known-folders.zig --pkg-end
mv bkg_runtime "build/bkg_runtime-${VERSION}-x86_64-linux"
# Build bkg_runtime for aarch64-linux
echo "Building bkg runtime for aarch64-linux..."
zig build-exe -target aarch64-linux-gnu -Drelease-fast src/bkg_runtime.zig -fstrip -lc deps/lz4/lib/lz4.c deps/microtar/src/microtar.c --pkg-begin known-folders deps/known-folders/known-folders.zig --pkg-end
mv bkg_runtime "build/bkg_runtime-${VERSION}-aarch64-linux"
# Build bkg_runtime for x86_64-macos
echo "Building bkg runtime for x86_64-macos..."
zig build-exe -target x86_64-macos -Drelease-fast src/bkg_runtime.zig -fstrip -lc deps/lz4/lib/lz4.c deps/microtar/src/microtar.c --pkg-begin known-folders deps/known-folders/known-folders.zig --pkg-end
mv bkg_runtime "build/bkg_runtime-${VERSION}-x86_64-macos"
# Build bkg_runtime for aarch64-macos
echo "Building bkg runtime for aarch64-macos..."
zig build-exe -target aarch64-macos -Drelease-fast src/bkg_runtime.zig -fstrip -lc deps/lz4/lib/lz4.c deps/microtar/src/microtar.c --pkg-begin known-folders deps/known-folders/known-folders.zig --pkg-end
mv bkg_runtime "build/bkg_runtime-${VERSION}-aarch64-macos"
echo "Done!"