-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·50 lines (40 loc) · 1.33 KB
/
build.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.33 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
#!/bin/bash
set -e
if [ -n "$1" ]; then
PRESET="$1"
else
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]; then
PRESET="linux-x64-release"
else
PRESET="linux-x86-release"
fi
fi
echo "Using preset: $PRESET"
if ! grep -q "\"name\": \"$PRESET\"" CMakePresets.json; then
echo "ERROR: Preset '$PRESET' not found in CMakePresets.json"
echo "Available Linux presets: linux-x86-release, linux-x64-release"
exit 1
fi
# Install vcpkg if not present
if [ ! -d "$HOME/vcpkg" ]; then
echo "vcpkg not found. Installing..."
git clone https://github.com/Microsoft/vcpkg.git "$HOME/vcpkg"
"$HOME/vcpkg/bootstrap-vcpkg.sh"
fi
# Determine build directory from preset
BUILD_DIR=$(grep -A 10 "\"name\": \"$PRESET\"" CMakePresets.json | grep "binaryDir" | sed 's/.*"binaryDir": "\${sourceDir}\///' | sed 's/".*//')
# Clean any partial build artifacts
if [ -n "$BUILD_DIR" ] && [ -d "$BUILD_DIR" ]; then
echo "Cleaning previous build artifacts in $BUILD_DIR..."
rm -rf "$BUILD_DIR/CMakeCache.txt" "$BUILD_DIR/CMakeFiles"
fi
export VCPKG_ROOT="$HOME/vcpkg"
echo ""
echo "=== Building MySQLOO with preset: $PRESET ==="
echo "This may take several minutes on first run as vcpkg builds dependencies from source..."
echo ""
cmake --preset "$PRESET"
cmake --build --preset "$PRESET"
echo ""
echo "Build complete!"