Skip to content

Commit c44342d

Browse files
committed
Add vcpkg installation instructions and static linking guidance to README
1 parent 81a4bee commit c44342d

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,49 @@ A high-performance C++ HTTP/WebSocket client library built on Boost.Beast with f
3131

3232
## Installation
3333

34+
### Dependencies via vcpkg
35+
36+
Install [vcpkg](https://github.com/microsoft/vcpkg) and bootstrap it:
37+
38+
```bash
39+
git clone https://github.com/Microsoft/vcpkg.git
40+
cd vcpkg
41+
./bootstrap-vcpkg.sh # Linux/macOS
42+
.\bootstrap-vcpkg.bat # Windows
43+
```
44+
45+
Install the required packages (select the triplet that matches your platform):
46+
47+
| Platform | Default triplet | Static triplet |
48+
|---|---|---|
49+
| Windows x64 | `x64-windows` | `x64-windows-static` |
50+
| Linux x64 | `x64-linux` | *(already static)* |
51+
| Linux arm64 | `arm64-linux` | *(already static)* |
52+
| macOS x64 | `x64-osx` | `x64-osx-static` |
53+
| macOS arm64 | `arm64-osx` | `arm64-osx-static` |
54+
55+
```bash
56+
vcpkg install boost-asio boost-beast boost-context boost-system openssl --triplet <triplet>
57+
```
58+
59+
Then pass the vcpkg toolchain file to CMake:
60+
61+
```bash
62+
cmake -B build \
63+
-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake \
64+
-DVCPKG_TARGET_TRIPLET=<triplet>
65+
```
66+
67+
#### Static linking
68+
69+
Pass `-DLINK_STATICALLY=ON` to CMake — it sets the correct static vcpkg triplet automatically and enables static Boost/OpenSSL linkage:
70+
71+
```bash
72+
cmake -B build \
73+
-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake \
74+
-DLINK_STATICALLY=ON
75+
```
76+
3477
### CMake Integration
3578

3679
Add slick-net as a subdirectory in your CMake project:

0 commit comments

Comments
 (0)