-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
82 lines (73 loc) · 2.16 KB
/
Copy pathbuild.bat
File metadata and controls
82 lines (73 loc) · 2.16 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
73
74
75
76
77
78
79
80
81
82
@echo off
setlocal EnableDelayedExpansion
title Building DiscordPresenceRE9...
echo ================================================
echo Building DiscordPresenceRE9.dll
echo REFramework Plugin for Resident Evil Requiem
echo ================================================
echo.
:: -----------------------------------------------
:: Find Visual Studio vcvars64.bat
:: -----------------------------------------------
set "VCVARS="
for %%Y in (2022 2019 2017) do (
for %%E in (BuildTools Community Professional Enterprise) do (
if exist "C:\Program Files (x86)\Microsoft Visual Studio\%%Y\%%E\VC\Auxiliary\Build\vcvars64.bat" (
set "VCVARS=C:\Program Files (x86)\Microsoft Visual Studio\%%Y\%%E\VC\Auxiliary\Build\vcvars64.bat"
echo Found: Visual Studio %%Y %%E
goto :found_vs
)
if exist "C:\Program Files\Microsoft Visual Studio\%%Y\%%E\VC\Auxiliary\Build\vcvars64.bat" (
set "VCVARS=C:\Program Files\Microsoft Visual Studio\%%Y\%%E\VC\Auxiliary\Build\vcvars64.bat"
echo Found: Visual Studio %%Y %%E
goto :found_vs
)
)
)
echo ERROR: Visual Studio not found!
pause
exit /b 1
:found_vs
echo Setting up 64-bit compiler environment...
call "%VCVARS%" x64 > nul 2>&1
:: -----------------------------------------------
:: Build with cl.exe directly (no CMake needed!)
:: -----------------------------------------------
set "SRC=%~dp0src\main.cpp"
set "OUT=%~dp0DiscordPresenceRE9.dll"
set "PLUGINS_DIR=%~dp0reframework\plugins"
echo Compiling...
echo.
cl.exe ^
/LD ^
/O2 ^
/GL ^
/GS- ^
/std:c++17 ^
/EHsc ^
/DWIN32_LEAN_AND_MEAN ^
/DNOMINMAX ^
/W3 ^
"%SRC%" ^
/Fe:"%OUT%" ^
/link ^
/DLL ^
/LTCG ^
/OPT:REF ^
/OPT:ICF ^
kernel32.lib
if errorlevel 1 (
echo.
echo ERROR: Compilation failed!
pause
exit /b 1
)
if not exist "%PLUGINS_DIR%" mkdir "%PLUGINS_DIR%"
move /Y "%OUT%" "%PLUGINS_DIR%\DiscordPresenceRE9.dll" > nul
echo.
echo ================================================
echo SUCCESS!
echo DLL: %PLUGINS_DIR%\DiscordPresenceRE9.dll
echo ================================================
echo.
pause