-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_macos.sh
More file actions
executable file
·63 lines (55 loc) · 1.8 KB
/
build_macos.sh
File metadata and controls
executable file
·63 lines (55 loc) · 1.8 KB
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
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Build script for macOS
echo "╔════════════════════════════════════════════╗"
echo "║ Building Paddle Decoder for macOS ║"
echo "╚════════════════════════════════════════════╝"
echo ""
# Check Rust
if ! command -v cargo &> /dev/null; then
echo "❌ Rust not found!"
echo " Install from: https://rustup.rs"
exit 1
fi
echo "✓ Rust found: $(rustc --version)"
echo ""
# Check Xcode tools
if ! xcode-select -p &> /dev/null; then
echo "❌ Xcode Command Line Tools not found!"
echo " Run: xcode-select --install"
exit 1
fi
echo "✓ Xcode tools found"
echo ""
# Detect architecture
ARCH=$(uname -m)
echo "System architecture: $ARCH"
if [ "$ARCH" = "arm64" ]; then
echo "✓ Building for Apple Silicon (ARM64)"
elif [ "$ARCH" = "x86_64" ]; then
echo "✓ Building for Intel (x86_64)"
fi
echo ""
# Build
echo "Building release version..."
echo ""
cargo build --release
if [ $? -eq 0 ]; then
echo ""
echo "╔════════════════════════════════════════════╗"
echo "║ ✅ Build successful! ║"
echo "╚════════════════════════════════════════════╝"
echo ""
echo "Binary location: target/release/paddle_decoder"
echo ""
echo "To run:"
echo " cargo run --release"
echo " OR"
echo " ./target/release/paddle_decoder"
echo ""
echo "To create .app bundle, see BUILD_MACOS.md"
echo ""
else
echo ""
echo "❌ Build failed!"
exit 1
fi