-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
63 lines (52 loc) · 1.78 KB
/
Copy pathbuild.bat
File metadata and controls
63 lines (52 loc) · 1.78 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
@echo off
REM Build script for Multicore Load Balancing Scheduler
REM Requires Visual Studio or MinGW
echo ================================================
echo Multicore Load Balancing Scheduler Build
echo ================================================
REM Check for Visual Studio (MSVC)
where cl.exe >nul 2>&1
if %errorlevel% == 0 (
echo Using MSVC (Visual Studio)...
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
echo Compiling...
cl /O2 /D_CRT_SECURE_NO_WARNINGS /W3 /Fe:scheduler.exe main.c src\kernel_detect.c src\scheduler.c src\ui.c src\gui.c /link kernel32.lib advapi32.lib ws2_32.lib
if %errorlevel% == 0 (
echo Build successful: scheduler.exe
) else (
echo Build failed!
exit /b 1
)
exit /b 0
)
REM Check for MinGW
where gcc.exe >nul 2>&1
if %errorlevel% == 0 (
echo Using MinGW...
echo Compiling...
gcc -O2 -Wall -D_CRT_SECURE_NO_WARNINGS -Iinclude -o scheduler.exe main.c src/kernel_detect.c src/scheduler.c src/ui.c src/gui.c -lkernel32 -ladvapi32 -lws2_32 -lcrypt32
if %errorlevel% == 0 (
echo Build successful: scheduler.exe
) else (
echo Build failed!
exit /b 1
)
exit /b 0
)
REM Check for TDM-GCC
where tdm-gcc.exe >nul 2>&1
if %errorlevel% == 0 (
echo Using TDM-GCC...
echo Compiling...
gcc -O2 -Wall -D_CRT_SECURE_NO_WARNINGS -Iinclude -o scheduler.exe main.c src/kernel_detect.c src/scheduler.c src/ui.c src/gui.c -lkernel32 -ladvapi32 -lws2_32 -lcrypt32
if %errorlevel% == 0 (
echo Build successful: scheduler.exe
) else (
echo Build failed!
exit /b 1
)
exit /b 0
)
echo Error: No C compiler found!
echo Please install Visual Studio or MinGW-w64
exit /b 1