-
Notifications
You must be signed in to change notification settings - Fork 3
/
compile.bat
43 lines (35 loc) · 1.09 KB
/
compile.bat
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
@echo off
erase /F /S /Q libtable.dll libtable-dbg.dll > NUL
set BUILD_TYPE=Release
set BUILD_DIR=build-release
echo Compiling %BUILD_TYPE% in %BUILD_DIR%
cmake -B %BUILD_DIR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .
if %ERRORLEVEL% NEQ 0 goto Failure
cmake --build %BUILD_DIR% --config %BUILD_TYPE%
if %ERRORLEVEL% NEQ 0 goto Failure
cd %BUILD_DIR%
ctest --build-config %BUILD_TYPE% --output-on-failure
if %ERRORLEVEL% NEQ 0 goto Failure
cd ..
copy %cd%\%BUILD_DIR%\src\%BUILD_TYPE%\table.dll %cd%\libtable.dll
echo SUCCESS building release into libtable.dll
set BUILD_TYPE=Debug
set BUILD_DIR=build-debug
echo Compiling %BUILD_TYPE% in %BUILD_DIR%
cmake -B %BUILD_DIR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% .
if %ERRORLEVEL% NEQ 0 goto Failure
cmake --build %BUILD_DIR% --config %BUILD_TYPE%
if %ERRORLEVEL% NEQ 0 goto Failure
cd %BUILD_DIR%
ctest --build-config %BUILD_TYPE% --output-on-failure
if %ERRORLEVEL% NEQ 0 goto Failure
cd ..
copy %cd%\%BUILD_DIR%\src\%BUILD_TYPE%\table.dll %cd%\libtable-dbg.dll
echo SUCCESS building debug into libtable-dbg.dll
start "" "%cd%"
pause
exit 0
:Failure
echo FAILED
pause
exit 1