-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
57 lines (47 loc) · 1.47 KB
/
Copy pathbuild.bat
File metadata and controls
57 lines (47 loc) · 1.47 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
@echo off
setlocal enabledelayedexpansion
rem UnityRuntimeExplorer build launcher.
rem build.bat -> interactive menu
rem build.bat msvc release -> non-interactive
rem build.bat clang debug clean -> non-interactive + wipe build dir
rem build.bat clang release tests -> non-interactive + build contract tests
set "COMPILER=%~1"
set "CONFIG=%~2"
set "EXTRA=%~3"
if "%COMPILER%"=="" (
echo === UnityRuntimeExplorer Build ===
echo.
echo Compiler:
echo [1] Clang
echo [2] MSVC ^(cl.exe^)
choice /c 12 /n /m "Select compiler: "
if errorlevel 2 (set "COMPILER=msvc") else (set "COMPILER=clang")
echo.
)
if "%CONFIG%"=="" (
echo Configuration:
echo [1] Release
echo [2] Debug
choice /c 12 /n /m "Select configuration: "
if errorlevel 2 (set "CONFIG=debug") else (set "CONFIG=release")
echo.
)
if "%EXTRA%"=="" (
choice /c yn /n /m "Clean the existing build output first? (y/n): "
if errorlevel 2 (set "EXTRA=") else (set "EXTRA=clean")
echo.
)
set "PS_ARGS=-Compiler %COMPILER% -Config %CONFIG%"
if /i "%EXTRA%"=="clean" set "PS_ARGS=%PS_ARGS% -Clean"
if /i "%EXTRA%"=="tests" set "PS_ARGS=%PS_ARGS% -Tests"
echo Running: powershell -File build.ps1 %PS_ARGS%
echo.
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0build.ps1" %PS_ARGS%
set "RC=%ERRORLEVEL%"
echo.
if "%RC%"=="0" (
echo Build finished successfully.
) else (
echo Build failed with exit code %RC%.
)
exit /b %RC%