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

Update setting-up-vcpkg documentation #2246

Merged
merged 5 commits into from
Feb 28, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions doc/setting_up_vcpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@

This document describes how to setup vcpkg to build applications using Microsoft Azure IoT device C SDK. It demonstrates building and running a C language SDK sample for Windows, Linux, and Mac.

## C SDK vcpkg support

The C SDK uses [vcpkg](https://github.com/microsoft/vcpkg) primarily for LTS releases. The most recent LTS release can be installed using the syntax: `vcpkg install azure-iot-sdk-c` and builds using the following CMake flags:

```
-Dskip_samples=ON
-Duse_installed_dependencies=ON
-Duse_default_uuid=ON
-Dbuild_as_dynamic=OFF
-Duse_edge_modules=ON
-Dwarnings_as_errors=OFF
```

The `use-prov-client` feature uses the syntax: `vcpkg install azure-iot-sdk-c[use-prov-client]` and builds using additional CMake flags:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for tag if you spoke offline, but @CIPop could you please double check that these flags still make sense in light of #2229? If not very well need a vcpkg PR, but since it's on mind wanted to ask. Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We def need to review this entire vcpkg portfile.cmake. There is a card to do that if it is not updated beforehand.

```
-Dhsm_type_symm_key=ON
-Duse_prov_client=ON
```

The `public-preview` feature allows you to build and install the azure-iot-sdk-c from a provided public-preview hash. The Ref hash used can be found in the [portfile.cmake](https://github.com/microsoft/vcpkg/blob/master/ports/azure-iot-sdk-c/portfile.cmake) file. To access this feature, use the syntax: `vcpkg install azure-iot-sdk-c[public-preview]`. The following CMake flags will be set:

```
-Dskip_samples=ON
-Duse_installed_dependencies=ON
-Duse_default_uuid=ON
-Dbuild_as_dynamic=OFF
-Duse_edge_modules=ON
-Dwarnings_as_errors=OFF
```

There are no other features available.

> NOTE: If your application requires specific CMake flags not shown above, please build and install directly from the source code. See [devbox_update.md](https://github.com/Azure/azure-iot-sdk-c/blob/main/doc/devbox_setup.md) for further information.

The most recent [portfile.cmake](https://github.com/microsoft/vcpkg/blob/master/ports/azure-iot-sdk-c/portfile.cmake) and [vcpkg.json](https://github.com/microsoft/vcpkg/blob/master/ports/azure-iot-sdk-c/vcpkg.json) files for the C SDK can be found under [vcpkg/ports/azure-iot-sdk-c](https://github.com/microsoft/vcpkg/tree/master/ports/azure-iot-sdk-c).


## Setup C SDK vcpkg for Windows development environment

- Open PowerShell and run the following commands:
Expand Down