Commit 29b857b
committed
Integrate vcpkg to manage dependencies for all platforms (Windows, Linux, macOS)
### Motivation
Currently we manage dependencies by ourselves:
- When running unit tests in CI, dependencies are installed from the
Debian package management tool `apt`
- When verifying macOS build, dependencies are installed from the
Homebrew package manager
- When verifying Windows build, dependencies are installed via vcpkg but
no versions are specified
- When building pre-built binaries to release, dependencies are
installed by scripts under `pkg/` directories. These scripts download
the source code according to `dependencies.yaml` and build
It makes the pre-built binaries never tested except for the simple
manual tests when voting for a new release. As a result, regression like
#363 could happen.
This patch aims at integrating vcpkg to manage dependencies for all
platforms, not only for Windows.
### Modifications
Integrate the CMakeLists.txt with vcpkg by:
1. Introduce vcpkg as a submodule of this project
2. Update `vcpkg.json` to specify dependency versions.
3. Set `CMAKE_TOOLCHAIN_FILE` with the `vcpkg.cmake` in the submodule.
Then, we can simply use `find_package` to find all dependencies and
depend on them via a target like `CURL::libcurl` to have all include
directores and link libraries.
Update the `unit-tests` workflow to verify building the binaries via
vcpkg to test. The README is also updated to show how much simpler to
build with vcpkg now.
### TODO
There are still some tasks that cannot be done by vcpkg:
1. The static library (e.g. `libpulsarwithdeps.a`) that bundles all
3rd-party dependencies.
2. The pre-built binaries are still built by scripts under `./pkg`
directory. Specifically, vcpkg does not work with GCC 4.8 so on
CentOS 7 we still need to build dependencies manually.
So the previous CMakeLists.txt are retained and will be used if
`INTEGRATE_VCPKG` is OFF (by default). They will be removed until the
task above can be done by vcpkg in future.1 parent 7087a8e commit 29b857b
File tree
17 files changed
+1023
-626
lines changed- .github/workflows
- examples
- lib
- perf
- tests
17 files changed
+1023
-626
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 72 | + | |
84 | 73 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 74 | + | |
| 75 | + | |
89 | 76 | | |
90 | 77 | | |
91 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
92 | 84 | | |
93 | | - | |
| 85 | + | |
94 | 86 | | |
95 | | - | |
96 | | - | |
| 87 | + | |
97 | 88 | | |
98 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments