-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
73 lines (61 loc) · 1.71 KB
/
build.bat
File metadata and controls
73 lines (61 loc) · 1.71 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
@echo off
setlocal EnableDelayedExpansion
REM Set NO_PAUSE=1 to skip pauses for non-interactive CI/runs
if "%NO_PAUSE%"=="1" set SKIP_PAUSE=1
echo Building BASIC + Raylib for Windows...
REM Check if we're in the right directory
if not exist "CMakeLists.txt" (
echo Error: CMakeLists.txt not found. Please run this from the project root.
if not defined SKIP_PAUSE pause
exit /b 1
)
set BUILD_COMMAND=
if exist "C:\msys64\mingw64\bin" (
@echo off
setlocal
REM Setup MinGW environment
set "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
REM Clean previous build directory
REM Configure
echo --- Configuring CMake ---
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
if %errorlevel% neq 0 (
echo CMake configuration failed.
exit /b %errorlevel%
)
REM Build
echo.
echo --- Building Project ---
cmake --build build --config Release
if %errorlevel% neq 0 (
echo Build failed.
exit /b %errorlevel%
)
echo.
echo --- Build Successful ---
endlocal
) else (
echo Error: MinGW-w64 not found at C:\msys64\mingw64. Please install MSYS2 and the MinGW-w64 toolchain.
if not defined SKIP_PAUSE pause
exit /b 1
)
set BUILD_RET=%ERRORLEVEL%
if %BUILD_RET% neq 0 (
echo Build failed.
if not defined SKIP_PAUSE pause
exit /b %BUILD_RET%
)
if %ERRORLEVEL% neq 0 (
echo Build failed
if not defined SKIP_PAUSE pause
exit /b 1
)
echo.
echo Build completed successfully!
echo Executable: build\cyberbasic.exe
echo.
echo To run examples:
echo build\cyberbasic.exe examples\hello_text.bas
echo build\cyberbasic.exe examples\hello_graphics.bas
echo.
if not defined SKIP_PAUSE pause