-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
36 lines (28 loc) · 1017 Bytes
/
build.sh
File metadata and controls
36 lines (28 loc) · 1017 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
#!/bin/bash
# Exit on error
set -e
# Check for required tools
command -v x86_64-w64-mingw32-g++ >/dev/null 2>&1 || { echo "Error: MinGW-w64 cross compiler not found"; exit 1; }
command -v cmake >/dev/null 2>&1 || { echo "Error: CMake not found"; exit 1; }
# Create and enter build directory
mkdir -p build
cd build
# Configure CMake for cross-compilation
cmake -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
-DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres \
-DCMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_BUILD_TYPE=Release \
..
# Build project
cmake --build . --config Release
# Copy resources
mkdir -p bin/Release/resources
cp -r ../resources/* bin/Release/resources/
# Return to original directory
cd ..
echo "Build completed successfully"