-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-mxe.sh
executable file
·42 lines (30 loc) · 696 Bytes
/
build-mxe.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
#!/bin/sh
PLATFORM="mxe"
SRC_DIR="build/src"
BUILD_DIR="build/$PLATFORM"
INSTALL_DIR="dist/$PLATFORM"
SRC_PATH="$(pwd)/$SRC_DIR"
INSTALL_PATH="$(pwd)/$INSTALL_DIR"
if [ ! -d "$SRC_PATH" ]; then
echo "SOURCE NOT FOUND!"
exit 1
fi
# ---
TOOLCHAIN_FILE="$(pwd)/cmake/mxe.cmake"
cmake -H"$SRC_DIR" -B"$BUILD_DIR" \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLIBRARY_OUTPUT_PATH="$INSTALL_PATH/lib"
if [ $? != 0 ]; then
echo "CONFIGURATION FAILED!"
exit -1
fi
# ---
rm -rf "$INSTALL_PATH" # XXX: REQUIRED?
cmake --build "$BUILD_DIR"
if [ $? != 0 ]; then
echo "BUILD FAILED!"
exit -1
fi
cd "$INSTALL_PATH"
ln -s "$SRC_PATH/include"