-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
62 lines (49 loc) · 1.14 KB
/
build.bat
File metadata and controls
62 lines (49 loc) · 1.14 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
:: Define directories and log file
set "BUILD_DIR=build"
set "WINDOWS_BUILD_DIR=%BUILD_DIR%\windows"
set "BIN_DIR=bin"
set "LOG_FILE=build.log"
:: Function to log messages
call :log "Starting Windows build..."
:: Clean up previous builds
if exist "%BIN_DIR%" (
rmdir /s /q "%BIN_DIR%"
call :log "Removed existing bin directory."
)
:: Create required directories
mkdir "%WINDOWS_BUILD_DIR%"
call :log "Created build directory: %WINDOWS_BUILD_DIR%"
:: Navigate to the build directory
pushd "%WINDOWS_BUILD_DIR%"
call :log "Navigated to build directory."
:: Run CMake and build
mingw64-cmake ../..
if errorlevel 1 (
call :log "CMake configuration failed."
exit /b 1
)
call :log "CMake configuration successful."
:: Build the project
make
if errorlevel 1 (
call :log "Build failed."
exit /b 1
)
call :log "Build completed successfully."
:: Navigate back
popd
:: Zip the output files
cd "%BIN_DIR%"
if exist "*" (
zip -r "%BUILD_DIR%\zip\windows.zip" *
call :log "Zipped binaries into windows.zip."
) else (
call :log "No binaries found to zip."
)
exit /b 0
:log
echo %1 >> %LOG_FILE%
echo %1
exit /b 0