-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpprestsdk_vs2019.bat
78 lines (66 loc) · 2.94 KB
/
cpprestsdk_vs2019.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
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
@echo off
setlocal
set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
for /f "usebackq tokens=*" %%i in (`%VSWHERE% -version 16.0 -property installationPath`) do (
set VS_INSTALL_DIR=%%i
)
call "%VS_INSTALL_DIR%\Common7\Tools\VsDevCmd.bat"
set BUILD_DIR=%~dp0
set CPPREST_DIR=%BUILD_DIR%\..\cpprestsdk
set VCPKG_DIR=%CPPREST_DIR%\vcpkg
set VCPKG_TOOLCHAIN=%VCPKG_DIR%\scripts\buildsystems\vcpkg.cmake
set STATIC_OPTIONS=-DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED_LIBS:BOOL=FALSE -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>"
if /I "%1"=="build" (
set BUILD_CMD=cmake --build . --config Debug ^& cmake --build . --config Release
) else (
set BUILD_CMD=echo.
)
echo.
echo winhttp-x64-windows
mkdir "%BUILD_DIR%\winhttp-x64-windows"
pushd "%BUILD_DIR%\winhttp-x64-windows"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo winhttp-x64-windows-narrow
mkdir "%BUILD_DIR%\winhttp-x64-windows-narrow"
pushd "%BUILD_DIR%\winhttp-x64-windows-narrow"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" -DCPPREST_FORCE_NARROW_STRINGS:BOOL=TRUE "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo winhttp-x64-windows-static
mkdir "%BUILD_DIR%\winhttp-x64-windows-static"
pushd "%BUILD_DIR%\winhttp-x64-windows-static"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" %STATIC_OPTIONS% "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo winhttp-x64-windows-static-narrow
mkdir "%BUILD_DIR%\winhttp-x64-windows-static-narrow"
pushd "%BUILD_DIR%\winhttp-x64-windows-static-narrow"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" %STATIC_OPTIONS% -DCPPREST_FORCE_NARROW_STRINGS:BOOL=TRUE "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo asio-x64-windows
mkdir "%BUILD_DIR%\asio-x64-windows"
pushd "%BUILD_DIR%\asio-x64-windows"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" -DCPPREST_HTTP_CLIENT_IMPL=asio -DCPPREST_HTTP_LISTENER_IMPL=asio -DCMAKE_CXX_FLAGS="/DCPPREST_FORCE_HTTP_CLIENT_ASIO /EHsc" "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo asio-x64-windows-static
mkdir "%BUILD_DIR%\asio-x64-windows-static"
pushd "%BUILD_DIR%\asio-x64-windows-static"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" %STATIC_OPTIONS% -DCPPREST_HTTP_CLIENT_IMPL=asio -DCPPREST_HTTP_LISTENER_IMPL=asio -DCMAKE_CXX_FLAGS="/DCPPREST_FORCE_HTTP_CLIENT_ASIO /EHsc" "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd
echo.
echo winrt-x64-uwp
mkdir "%BUILD_DIR%\winrt-x64-uwp"
pushd "%BUILD_DIR%\winrt-x64-uwp"
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE="%VCPKG_TOOLCHAIN%" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 "%CPPREST_DIR%\Release"
%BUILD_CMD%
popd