Skip to content

Commit ce10c24

Browse files
committed
Add a separate build script for building the project using msvc-wine
Running win-build.bat inside Wine would be impractical, since the msbuild wrapper script shipped by msvc-wine cannot properly set up the environment variables if invoked from within Wine.
1 parent 72c05bf commit ce10c24

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

wine-build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
if [ -z "$MSBUILDPATH" ]; then
4+
echo "Could not find MSBuild. Make sure the MSBUILDPATH environment variable points"
5+
echo "to either MSBuild.exe or a script that handles the invocation of MSBuild.exe."
6+
exit 1
7+
fi
8+
echo "Found MSBuild at: $MSBUILDPATH"
9+
10+
BUILD_CONFIGURATION=Release
11+
BUILD_PLATFORM=Win32
12+
13+
# Read configuration (1st parameter)
14+
case ${1,,} in
15+
debug) BUILD_CONFIGURATION=Debug ;;
16+
release) BUILD_CONFIGURATION=Release ;;
17+
"") ;;
18+
*) echo "Invalid first argument $1. Using default configuration $BUILD_CONFIGURATION." ;;
19+
esac
20+
21+
# Read platform (2nd parameter)
22+
case ${2,,} in
23+
win32) BUILD_PLATFORM=Win32 ;;
24+
x64) BUILD_PLATFORM=x64 ;;
25+
arm) BUILD_PLATFORM=ARM ;;
26+
arm64) BUILD_PLATFORM=ARM64 ;;
27+
"") ;;
28+
*) echo "Invalid second argument $2. Using default platform $BUILD_PLATFORM." ;;
29+
esac
30+
31+
echo "Build configuration:"
32+
echo " BUILD_CONFIGURATION = $BUILD_CONFIGURATION"
33+
echo " BUILD_PLATFORM = $BUILD_PLATFORM"
34+
35+
# Create solution (ignoring pause)
36+
wine win-create-projects.bat < /dev/null
37+
echo ""
38+
39+
# Start compiling
40+
"$MSBUILDPATH" Build/MTASA.sln -property:Configuration="$BUILD_CONFIGURATION" -property:Platform="$BUILD_PLATFORM" -maxCpuCount

0 commit comments

Comments
 (0)