Repository navigation
Expand file tree
/
Copy pathSetup.bat
More file actions
62 lines (52 loc) · 1.78 KB
/
Copy pathSetup.bat
File metadata and controls
62 lines (52 loc) · 1.78 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
@echo off
setlocal EnableDelayedExpansion
pushd "%~dp0"
if /i "%~1"=="--no-pause" set "NO_PAUSE=1"
echo ==========================================
echo XBase Project Generator
echo ==========================================
set "PREMAKE_EXE="
if exist "tools\premake5.exe" set "PREMAKE_EXE=tools\premake5.exe"
if not defined PREMAKE_EXE if exist "..\XMenu\tools\premake5.exe" set "PREMAKE_EXE=..\XMenu\tools\premake5.exe"
if not defined PREMAKE_EXE for /f "tokens=*" %%i in ('where premake5.exe 2^>nul') do if not defined PREMAKE_EXE set "PREMAKE_EXE=%%i"
if not defined PREMAKE_EXE for /f "tokens=*" %%i in ('where premake5 2^>nul') do if not defined PREMAKE_EXE set "PREMAKE_EXE=%%i"
if not defined PREMAKE_EXE (
echo [Error] premake5 executable not found.
goto fail
)
if "%PLUGIN_SDK_DIR%"=="" (
if exist "..\plugin-sdk\" (
set "PLUGIN_SDK_DIR=..\plugin-sdk"
echo [Info] Auto-detected PLUGIN_SDK_DIR=!PLUGIN_SDK_DIR!
) else if exist "..\..\plugin-sdk\" (
set "PLUGIN_SDK_DIR=..\..\plugin-sdk"
echo [Info] Auto-detected PLUGIN_SDK_DIR=!PLUGIN_SDK_DIR!
) else (
echo [Error] plugin-sdk not found. Three-version backends require PLUGIN_SDK_DIR.
goto fail
)
)
if not exist "%PLUGIN_SDK_DIR%" (
echo [Error] Invalid plugin-sdk directory: %PLUGIN_SDK_DIR%
goto fail
)
echo Generating Visual Studio 2022 project files...
"!PREMAKE_EXE!" vs2022
if errorlevel 1 (
echo [Error] Project generation failed.
goto fail
)
if exist "build\XBase.sln" (
echo Project generation completed successfully.
echo You can now open "build\XBase.sln" in Visual Studio.
) else (
echo [Error] Failed to generate project files.
goto fail
)
popd
if not defined NO_PAUSE pause
exit /b 0
:fail
popd
if not defined NO_PAUSE pause
exit /b 1