-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-release.bat
More file actions
62 lines (51 loc) · 1.37 KB
/
build-release.bat
File metadata and controls
62 lines (51 loc) · 1.37 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
echo ===================================
echo Building MechCommanderNoCDPatch RELEASE version...
echo ===================================
:: Create build directory if it doesn't exist
if not exist build mkdir build
:: Navigate to build directory
cd build
:: Configure with CMake if CMakeCache.txt doesn't exist
if not exist CMakeCache.txt (
echo Configuring CMake project...
cmake .. || goto :error
)
:: Build the project in Release mode
echo Building project in Release mode...
cmake --build . --config Release || goto :error
:: If we get here, build was successful
echo.
echo ===================================
echo Build successful!
echo ===================================
echo.
:: Copy the executable to the project root
echo Copying executable to project root...
copy .\bin\Release\MechCommanderNoCDPatch.exe ..\ || goto :copy_error
echo.
echo Release executable copied to project root.
:: Return to original directory
cd ..
goto :end
:copy_error
echo.
echo ===================================
echo Error: Failed to copy executable!
echo ===================================
cd ..
exit /b 2
:error
echo.
echo ===================================
echo Error: Build failed!
echo ===================================
cd ..
exit /b 1
:end
echo.
echo ===================================
echo Release build complete!
echo ===================================
echo.
exit /b 0