-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
46 lines (38 loc) · 1.49 KB
/
build.bat
File metadata and controls
46 lines (38 loc) · 1.49 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
@echo off
setlocal enabledelayedexpansion
:: Find Visual Studio installation using vswhere
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if "%InstallDir%"=="" (
echo Error: Visual Studio C++ build tools not found.
exit /b 1
)
set VCVARS="%InstallDir%\VC\Auxiliary\Build\vcvars64.bat"
if not exist %VCVARS% (
echo Error: vcvars64.bat not found at %VCVARS%
exit /b 1
)
:: Initialize MSVC environment if not already initialized
if "%VSCMD_ARG_TGT_ARCH%"=="" (
:: Suppress the telemetry/logo output from vcvars
set VSCMD_SKIP_SENDTELEMETRY=1
call %VCVARS% > nul
)
:: Create an output directory for the build
if not exist bin mkdir bin
echo Compiling PerfectLoader...
:: Compiler flags based on your .vcxproj (Release/x64 config)
:: - O2: Optimize for speed
:: - W3: Warning level 3
:: - std:c++20: C++20 language standard
:: - MT: MultiThreaded static runtime
:: - D: Preprocessor definitions
cl.exe /nologo /O2 /W3 /MT /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_WARNINGS" /EHsc /I"." PerfectLoader.c core\PLRing3.c /link /SUBSYSTEM:WINDOWS d3d11.lib dxguid.lib user32.lib Comdlg32.lib /OUT:bin\PerfectLoader.exe
if %ERRORLEVEL% NEQ 0 (
echo.
echo [!] Build failed.
exit /b %ERRORLEVEL%
)
echo.
echo [=] Build succeeded! Executable is located at: bin\PerfectLoader.exe