You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(build): Unify dependency installation with vcpkg
The previous installation process was unreliable on modern Linux distributions (e.g., Ubuntu 24.04) and had inconsistent instructions for vcpkg.
This was caused by two key issues:
1. System package managers like `apt` no longer provide key dependencies (e.g., `libuwebsockets-dev`) on newer OS versions.
2. The `vcpkg` instructions were Windows-only, used an incorrect `unofficial-uwebsockets` package, and were not properly supported by the CMake configuration for Linux.
This commit overhauls the build system and documentation to make vcpkg the standard, recommended method for dependency management across all platforms.
- **CMakeLists.txt**: Now uses the official `uwebsockets` vcpkg package and correctly handles its integration on both Windows and Linux. The system library lookup is kept as a fallback.
- **README.md**: Updated to provide a single, cross-platform `vcpkg` command as the primary installation method. Instructions for system package managers are now a secondary option, with a warning about potential issues on newer systems.
This resolves installation failures on Ubuntu 24.04 and provides a more robust and maintainable build process for all users.
Copy file name to clipboardExpand all lines: README.md
+19-15Lines changed: 19 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ This project is a modern C++ RPC framework with several external dependencies. T
57
57
> **Note:**
58
58
> Starting from version 0.1.0, BinaryRPC expects you to set the `VCPKG_ROOT` environment variable to your vcpkg installation path **on Windows**. This makes the build process portable and avoids hardcoding paths. If you do not set this variable on Windows, CMake will stop with an error.
59
59
>
60
-
> **Linux/macOS users:** You don't need to set VCPKG_ROOT as the project uses system package managers on these platforms.
60
+
> **Linux/macOS users:** You can use your system package manager (like `apt` or `pacman`), but using `vcpkg` is recommended for better consistency, especially on newer distributions like Ubuntu 24.04 where some packages may not be available in the default repositories.
61
61
>
62
62
> **How to set VCPKG_ROOT (Windows only):**
63
63
> -**Windows (PowerShell):**
@@ -71,34 +71,34 @@ This project is a modern C++ RPC framework with several external dependencies. T
71
71
>
72
72
> Replace `/path/to/vcpkg` with the actual path where you cloned vcpkg.
73
73
74
-
#### Step 2.1: Install Dependencies with vcpkg
74
+
#### Step 2.1: Install Dependencies
75
75
76
-
First, ensure you have [vcpkg](https://github.com/microsoft/vcpkg) installed and bootstrapped. Then, install all required dependencies:
76
+
You can install dependencies using **vcpkg** (recommended for all platforms) or your system's package manager (Linux-only alternative).
77
77
78
-
# Install all dependencies for binaryrpc
78
+
### Option 1: Install with vcpkg (Recommended)
79
79
80
-
## Core Dependencies
80
+
First, ensure you have [vcpkg](https://github.com/microsoft/vcpkg) installed and bootstrapped. Then, run the following command to install all required dependencies. This command works for Windows, Linux, and macOS.
81
81
82
-
These are required for building and running the core framework:
> - On some distributions, the package names may differ or the packages may not be available in the default repositories. In that case, you may need to build [folly](https://github.com/facebook/folly) and [glog](https://github.com/google/glog) from source. Please refer to their official documentation for build instructions.
101
+
> - On some distributions, the package names may differ or the packages may not be available in the default repositories. In that case, you may need to build [folly](https://github.com/facebook/folly) and [glog](https://github.com/google/glog) from source or use vcpkg.
102
102
> -**Folly and glog can sometimes be incompatible on certain Linux systems.** If you encounter build errors related to glog, you can try disabling glog or ensure you are using compatible versions. On Linux, BinaryRPC disables glog logging by default if there is a known incompatibility.
103
103
> - If you see an error like `folly library not found!`, make sure folly is installed and the library path is visible to the linker (e.g., `/usr/lib` or `/usr/local/lib`).
104
104
> - If you see an error like `glog library not found!`, make sure glog is installed and the library path is visible to the linker.
@@ -130,8 +130,8 @@ cmake -E make_directory build
130
130
cd build
131
131
132
132
# 3. Configure the project with the vcpkg toolchain
133
-
#Use the VCPKG_ROOT environment variable for portability
0 commit comments