-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_run_all.cmd
More file actions
110 lines (95 loc) · 2.83 KB
/
_run_all.cmd
File metadata and controls
110 lines (95 loc) · 2.83 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
@echo off
REM ========================================
REM WinKernelLite main build script
REM ========================================
REM Usage: run_all.cmd [Debug|Release] [--build-only]
REM ========================================
set BUILD_CONFIG=Release
set COMMAND=all
set BUILD_DIR=build
REM Parse arguments
:parse_args
if "%1"=="" goto done_parsing
if /i "%1"=="Debug" (
set BUILD_CONFIG=Debug
shift
goto parse_args
)
if /i "%1"=="--build-only" (
set COMMAND=build-only
shift
goto parse_args
)
shift
goto parse_args
:done_parsing
echo ========================================
echo Configuring CMake...
echo ========================================
cmake -B %BUILD_DIR%
if %ERRORLEVEL% neq 0 (
echo ERROR: CMake configuration failed!
exit /b %ERRORLEVEL%
)
echo ========================================
echo Building main library in %BUILD_CONFIG% mode...
echo ========================================
cmake --build %BUILD_DIR% --config %BUILD_CONFIG%
if %ERRORLEVEL% neq 0 (
echo ERROR: Build failed!
exit /b %ERRORLEVEL%
)
if "%COMMAND%"=="build-only" goto success
echo ========================================
echo Running tests...
echo ========================================
if exist .\%BUILD_DIR%\runTests.exe (
cd /d .\%BUILD_DIR%
runTests.exe
cd /d ..
) else if exist .\%BUILD_DIR%\bin\runTests.exe (
cd /d .\%BUILD_DIR%\bin
runTests.exe
cd /d ..\..
) else (
echo ERROR: Cannot find test executable
echo Looked in .\%BUILD_DIR%\runTests.exe and .\%BUILD_DIR%\bin\runTests.exe
exit /b 1
)
if %ERRORLEVEL% neq 0 (
echo ERROR: Tests failed!
exit /b %ERRORLEVEL%
)
echo ========================================
echo Installing library...
echo ========================================
cmake --build %BUILD_DIR% --config %BUILD_CONFIG% --target install_WinKernelLite
if %ERRORLEVEL% neq 0 (
echo ERROR: Installation failed!
exit /b %ERRORLEVEL%
)
echo ========================================
echo Building examples...
echo ========================================
if not exist %BUILD_DIR%\examples mkdir %BUILD_DIR%\examples
cmake -S examples -B %BUILD_DIR%\examples
if %ERRORLEVEL% neq 0 (
echo ERROR: Examples CMake configuration failed!
exit /b %ERRORLEVEL%
)
cmake --build %BUILD_DIR%\examples
if %ERRORLEVEL% neq 0 (
echo ERROR: Examples build failed!
exit /b %ERRORLEVEL%
)
:success
echo ========================================
echo All operations completed successfully!
echo ========================================
echo Build system: MSBuild
echo Build directory: %BUILD_DIR%
echo Main library: Built in %BUILD_DIR%\%BUILD_CONFIG%\WinKernelLite.lib
echo Library installed to Program Files
echo Examples: Built in %BUILD_DIR%\examples\bin\examples\
echo Tests: Available in %BUILD_DIR%\bin\runTests.exe
echo ========================================