-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·48 lines (37 loc) · 814 Bytes
/
Copy pathpackage.sh
File metadata and controls
executable file
·48 lines (37 loc) · 814 Bytes
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
#!/bin/sh
for arg in "$@"; do
if [ "$arg" = "clean" ]; then
./clean.sh
break
fi
done
[ ! -d build ] && mkdir build
echo "Configuring..."
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
if [ $? -ne 0 ]; then
echo "CMake failed. Aborting."
exit 1
else
echo "CMake succeeded."
fi
if [ -z "$THREADS" ]; then
THREADS=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
fi
echo "Building with $THREADS threads..."
cd build
make -j$THREADS
if [ $? -ne 0 ]; then
echo "Build failed. Aborting."
exit 1
else
echo "Build succeeded."
fi
echo "Packaging..."
make package
if [ $? -ne 0 ]; then
echo "Packaging failed. Aborting."
exit 1
else
echo "Packaging succeeded."
fi
echo "Done."