- CMake
- MS C++ Build tools
- Download
Build Tools for Visual Studio 2022and install it - Select
Desktop development with C++in theDesktop & Mobilesection and install the necessary components:-
MSVC v143 - VS 2022 C++ x64/x86 build tools
-
Windows 11 SDK
-
C++ ATL for latest v143 build tools
-
C++ MFC for latest v143 build tools
-
Edit the
Pathenviroment variable and append the folder's path that contains theMSBuild.exeto it, e.g.:C:\Users\asus\AppData\Local\Programs\Microsoft VS Code\bin\
-
- Download
To compile the program with TLS/SSL support you need OpenSSL:
Also required are:
For tests:
We recommend using vcpkg to install dependencies:
- Clone the repository to the recommended
C:\disk:
git clone --depth 1 https://github.com/microsoft/vcpkg.git- Run the
bootstrapscript:
.\vcpkg\bootstrap-vcpkg.bat- Edit the
Pathenviroment variable and append the folder's path:C:\vcpkg - Install all the dependencies:
vcpkg install openssl:x64-windows-static
vcpkg install libxml2:x64-windows-static
vcpkg install zlib:x64-windows-static
vcpkg install boost-filesystem:x64-windows-static
vcpkg install boost-json:x64-windows-static
vcpkg install boost-asio:x64-windows-static- For tests:
vcpkg install boost-test:x64-windows-staticFor Win32, instead of :x64-windows-static, use :x86-windows-static.
- Configure:
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -A x64- Or for Win32:
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -A Win32- Release build:
cmake --build . --config Release- Or for debug build:
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug - Debug build:
cmake --build . --config Debug- Now, you can find the binary in the
Release/Debugdirectory.
You may run configure with additional arguments:
- Disable TLS. Use this option if you cannot use OpenSSL:
cmake .. -DDISABLE_TLS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static- Enable tests:
cmake .. -DENABLE_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static- Run tests:
ctest -C Release- Or for debug build:
ctest -C Debug