Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate use of vcpkg for cross-platform dependency management #59

Open
rs22 opened this issue Aug 7, 2023 · 3 comments · May be fixed by #63
Open

Evaluate use of vcpkg for cross-platform dependency management #59

rs22 opened this issue Aug 7, 2023 · 3 comments · May be fixed by #63

Comments

@rs22
Copy link
Collaborator

rs22 commented Aug 7, 2023

Windows compatibility is an interesting feature for the medium-term future.

Towards that goal, what needs to be done?

  1. Supplying the dependencies
  2. Continue using platform-independent OS interfaces (e.g. Berkeley Sockets)
  3. Create platform-dependent implementations for other OS interfaces (I think mostly event loop (select/WaitForMultipleObjects))

To achieve 1., Microsoft provides a dependency resolution system (C++ package manager?) that works for Linux, Windows, macOS: https://github.com/microsoft/vcpkg

It integrates nicely with CMake and seems to include ports for everything we require:

  • wolfSSL
  • libsodium
  • gRPC
  • CTest
  • anything missing?
@laugengebaeck
Copy link
Collaborator

laugengebaeck commented Aug 16, 2023

This does not work at the moment, because vcpkg does not ship WolfSSL with DTLS support. Otherwise, vcpkg works quite well (apart from CMake forgetting about vcpkg when re-run the configure step and only trying to use it again after you deleted the whole CMake cache). You just install the packages (wolfssl, libsodium, grpc), provide the toolchain file path to CMake and then nearly everything works out of the box.

Edit: The "CMake forgetting stuff" thing seems to be more of a VS Code problem.

@laugengebaeck
Copy link
Collaborator

laugengebaeck commented Aug 16, 2023

Installing vcpkg (on branch vcpkg-dependencies):

git submodule update --init && ./vcpkg/bootstrap-vcpkg.sh --disableMetrics

Then configure CMake with --preset vcpkg (this automatically installs required packages) and you're good to go.

@laugengebaeck
Copy link
Collaborator

Vcpkg supports feature flags for ports, so we could add flags for dtls (and for the secret callback) and then do a PR in the official vcpkg repository.

See: https://devblogs.microsoft.com/cppblog/vcpkg-introducing-installation-options-with-feature-packages/

@laugengebaeck laugengebaeck linked a pull request Aug 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants