-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_windows.bat
More file actions
68 lines (59 loc) · 1.83 KB
/
Copy pathbuild_windows.bat
File metadata and controls
68 lines (59 loc) · 1.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
@echo off
:: OpenADS Windows build script
:: Requires: Visual Studio 2022 (any edition)
::
:: Outputs:
:: build\msvc-x64\src\Release\openace64.dll OpenADS ACE-compatible DLL
:: build\msvc-x64\Release\openads_serverd.exe standalone TCP server
:: build\msvc-x64\Release\openads_bench.exe SQL benchmark tool
::
:: Options (pass as arguments):
:: debug - build Debug instead of Release
:: notls - skip TLS support
:: nohttp - skip embedded web console (faster configure, no FetchContent)
:: tests - also run the test suite after building
setlocal
set BUILD_TYPE=Release
set WITH_TLS=OFF
set WITH_HTTP=ON
set RUN_TESTS=0
for %%A in (%*) do (
if /I "%%A"=="debug" set BUILD_TYPE=Debug
if /I "%%A"=="notls" set WITH_TLS=OFF
if /I "%%A"=="nohttp" set WITH_HTTP=OFF
if /I "%%A"=="tests" set RUN_TESTS=1
)
:: Use CMake bundled with VS2022 if cmake is not on PATH
where cmake >nul 2>&1
if errorlevel 1 (
set "PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
)
cmake --version
echo.
echo === Configuring (msvc-x64, %BUILD_TYPE%) ===
cmake --preset msvc-x64 ^
-DOPENADS_WITH_TLS=%WITH_TLS% ^
-DOPENADS_WITH_HTTP=%WITH_HTTP% ^
-DOPENADS_WARNINGS_AS_ERRORS=OFF
if errorlevel 1 goto :fail
echo.
echo === Building ===
cmake --build build/msvc-x64 --config %BUILD_TYPE% --parallel
if errorlevel 1 goto :fail
echo.
echo === Build complete ===
echo DLL : build\msvc-x64\src\%BUILD_TYPE%\openace64.dll
echo Srv : build\msvc-x64\%BUILD_TYPE%\openads_serverd.exe
echo Bench: build\msvc-x64\%BUILD_TYPE%\openads_bench.exe
if %RUN_TESTS%==1 (
echo.
echo === Running tests ===
ctest --test-dir build/msvc-x64 --output-on-failure -C %BUILD_TYPE%
)
endlocal
exit /b 0
:fail
echo.
echo === BUILD FAILED ===
endlocal
exit /b 1