-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
95 lines (83 loc) · 2.45 KB
/
Copy pathbuild.bat
File metadata and controls
95 lines (83 loc) · 2.45 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@echo off
REM Image Editor Build Script for Windows
REM This script builds and runs the image editor application
echo ==========================================
echo Professional Image Editor Build Script
echo ==========================================
echo.
REM Check if g++ is available
where g++ >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: g++ compiler not found!
echo.
echo Please install MSYS2 and add it to your PATH:
echo 1. Download MSYS2 from: https://www.msys2.org/
echo 2. Install MinGW-w64: pacman -S mingw-w64-x86_64-gcc
echo 3. Add C:\msys64\mingw64\bin to your PATH environment variable
echo.
pause
exit /b 1
)
echo Compiler found:
g++ --version | findstr "g++"
echo.
REM Create build directory if it doesn't exist
if not exist "build" mkdir build
if not exist "build\obj" mkdir build\obj
echo Building Image Editor...
echo.
REM Compile source files
echo Compiling bmp_processor.cpp...
g++ -std=c++17 -Wall -Wextra -O2 -c src\bmp_processor.cpp -o build\obj\bmp_processor.o
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to compile bmp_processor.cpp
pause
exit /b 1
)
echo Compiling http_server.cpp...
g++ -std=c++17 -Wall -Wextra -O2 -c src\http_server.cpp -o build\obj\http_server.o
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to compile http_server.cpp
pause
exit /b 1
)
echo Compiling main.cpp...
g++ -std=c++17 -Wall -Wextra -O2 -c src\main.cpp -o build\obj\main.o
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to compile main.cpp
pause
exit /b 1
)
REM Link executable
echo Linking executable...
g++ build\obj\bmp_processor.o build\obj\http_server.o build\obj\main.o -o build\image_editor.exe -lws2_32
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to link executable
pause
exit /b 1
)
echo.
echo ==========================================
echo Build completed successfully!
echo ==========================================
echo.
REM Ask user if they want to run the application
set /p choice="Do you want to run the Image Editor now? (Y/N): "
if /i "%choice%"=="Y" (
echo.
echo Starting Image Editor Server...
echo Open your browser and go to: http://localhost:8080
echo.
echo Press Ctrl+C to stop the server when you're done.
echo.
cd build
image_editor.exe
) else (
echo.
echo To run the Image Editor later:
echo 1. Navigate to the build directory
echo 2. Run: image_editor.exe
echo 3. Open your browser to: http://localhost:8080
echo.
)
pause