forked from philippj/SteamworksPy
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_win_64.bat
More file actions
72 lines (55 loc) · 1.81 KB
/
build_win_64.bat
File metadata and controls
72 lines (55 loc) · 1.81 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@echo off
echo [*] Building SteamworksPy
:check_arguments
if "%1"=="" (
echo [!] Please call this script with your Visual Studio Version as an argument!
exit /B 5
)
goto setup_environment
:setup_environment
echo [*] Setting up environment
set VS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\%1\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
if not exist %VS_PATH% (
echo [!] Could not find your Visual Studio %1 installation!
exit /B 5
)
call %VS_PATH%
goto check_for_steamworks
:steamworks_missing
echo [!] Your environment is not properly set up!
echo [!] Please follow the instructions in SteamworksPy\library\README.md
exit /B 5
:check_for_steamworks
if not exist "library\sdk\steam\*.h" goto steamworks_missing
if not exist "library\sdk\redist\steam_api64.dll" goto steamworks_missing
if not exist "library\sdk\redist\steam_api64.lib" goto steamworks_missing
goto main
:main
SET dirname=_build_%random%
echo [*] Building in %dirname%
mkdir %dirname%
echo [*] Copying SteamworksPy.cpp into build root
copy ".\library\SteamworksPy.cpp" ".\%dirname%\SteamworksPy.cpp"
echo [*] Copying Steamworks redist bins to build root
copy ".\library\sdk\redist\*" ".\%dirname%\"
echo [*] Linking SteamworksSDK into build root (Requires Admin!)
net session >nul 2>&1
if %errorLevel% NEQ 0 (
echo [!] This script requires administrator privileges for mklink!
exit /B 5
)
mklink /J ".\%dirname%\sdk" ".\library\sdk\"
cd %dirname%
echo [*] Building SteamworksPy.dll
cl.exe /D_USRDLL /D_WINDLL SteamworksPy.cpp steam_api64.lib /link /DLL /OUT:SteamworksPy64.dll
if %errorLevel% NEQ 0 (
echo [!] Compilation failed!
exit /B 5
)
echo [*] Moving finished library into main repo
move "SteamworksPy64.dll" "..\redist\windows\."
cd ..
echo [*] Cleanup
rmdir /S /Q %dirname%
echo [*] Build completed successfully!
exit /B 0