BewareMyPower opened a new pull request, #371:
URL: https://github.com/apache/pulsar-client-cpp/pull/371

   ### 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 
https://github.com/apache/pulsar-client-cpp/issues/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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to