Skip to content

Commit d81e73b

Browse files
Synchronize changes from 1.6 master branch [ci skip]
a9bd854 Make cross compiling the project using msvc-wine on Linux possible (PR #4332)
2 parents 13a8582 + a9bd854 commit d81e73b

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

utils/buildactions/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function os.sha256_file(path)
9696
local windows = os.host() == "windows"
9797
local s, errc
9898
if windows then
99-
s, errc = os.outputof(string.format("CertUtil -hashfile \"%s\" SHA256", path))
99+
s, errc = os.outputof(string.format("call \"utils\\7z\\7za.exe\" h -scrcSHA256 \"%s\"", path))
100100
else
101101
s, errc = os.outputof(string.format("sha256sum \"%s\" | awk '{ print $1 }'", path))
102102
end
@@ -109,7 +109,7 @@ function os.sha256_file(path)
109109

110110
-- Clean windows output
111111
if windows then
112-
s = (s:match("\n(.*)\n(.*)") or ""):gsub(" ", "")
112+
s = (s:match("SHA256 for data: +([^\n]*)") or "")
113113
end
114114

115115
return s:lower()

win-build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ IF /i [%2] == [Win32] (
4545
set BUILD_PLATFORM=ARM64
4646
) ELSE (
4747
IF not [%2] == [] (
48-
echo Invalid first argument %2. Using default platform %BUILD_PLATFORM%.
48+
echo Invalid second argument %2. Using default platform %BUILD_PLATFORM%.
4949
)
5050
)
5151

wine-build.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
echo ""
7+
echo "If using msvc-wine, it should point to /path/to/msvc-wine-install-dir/bin/x64/msbuild"
8+
exit 1
9+
fi
10+
echo "Found MSBuild at: $MSBUILDPATH"
11+
12+
BUILD_CONFIGURATION=Release
13+
BUILD_PLATFORM=Win32
14+
15+
# Read configuration (1st parameter)
16+
case ${1,,} in
17+
debug) BUILD_CONFIGURATION=Debug ;;
18+
release) BUILD_CONFIGURATION=Release ;;
19+
"") ;;
20+
*) echo "Invalid first argument $1. Using default configuration $BUILD_CONFIGURATION." ;;
21+
esac
22+
23+
# Read platform (2nd parameter)
24+
case ${2,,} in
25+
win32) BUILD_PLATFORM=Win32 ;;
26+
x64) BUILD_PLATFORM=x64 ;;
27+
arm) BUILD_PLATFORM=ARM ;;
28+
arm64) BUILD_PLATFORM=ARM64 ;;
29+
"") ;;
30+
*) echo "Invalid second argument $2. Using default platform $BUILD_PLATFORM." ;;
31+
esac
32+
33+
echo "Build configuration:"
34+
echo " BUILD_CONFIGURATION = $BUILD_CONFIGURATION"
35+
echo " BUILD_PLATFORM = $BUILD_PLATFORM"
36+
37+
# Create solution (ignoring pause)
38+
wine win-create-projects.bat < /dev/null
39+
echo ""
40+
41+
# Start compiling
42+
"$MSBUILDPATH" Build/MTASA.sln -property:Configuration="$BUILD_CONFIGURATION" -property:Platform="$BUILD_PLATFORM" -maxCpuCount

0 commit comments

Comments
 (0)