Repository navigation
First iteration of vcpkg build process #644
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8e49cd5
First iteration of vcpkg build process
maxgolov aaffc84
Spellcheck
maxgolov b265b3e
Clean-up the doc
maxgolov c6f1865
Update building-with-vcpkg.md
maxgolov 95e3c67
Update building-with-vcpkg.md
maxgolov 2302da6
Verified the flow on Linux for static and shared library. Use new Goo…
maxgolov 179d8c6
Merge branch 'maxgolov/vcpkg_first_pass' of https://github.com/micros…
maxgolov 539400b
Merge branch 'master' into maxgolov/vcpkg_first_pass
maxgolov eaa19bb
Addressing CI comments
maxgolov 8ff267f
Update to latest modules that contain a warning fix
maxgolov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Building 1DS C++ SDK with vcpkg | ||
|
|
||
| vcpkg is a Microsoft cross-platform open source C++ package manager. Onboarding instructions for Windows, Linux and Mac OS X [available here](https://docs.microsoft.com/en-us/cpp/build/vcpkg). This document assumes that the customer build system is already configured to use vcpkg. 1DS C++ SDK maintainers provide a build recipe, `mstelemetry` port or CONTROL file for vcpkg. Mainline vcpkg repo is refreshed to point to latest stable open source release of 1DS C++ SDK. Public build of SDK does not include private submodules. However, local port / CONTROL file included in 1DS C++ SDK git repo allows to build SDK with additional Microsoft-proprietary private submodules. | ||
|
|
||
| ## Installing open source mstelemetry package | ||
|
|
||
| The following command can be used to install the public open source release: | ||
|
|
||
| ``` | ||
| vcpkg install mstelemetry | ||
| ``` | ||
|
|
||
| That's it! The package should be compiled for the current OS. | ||
|
|
||
| See instructions below to build the SDK with additional Microsoft-proprietary modules. | ||
|
|
||
| ## Windows build with submodules | ||
|
|
||
| `cmd.exe` command line prompt commands: | ||
|
|
||
| ``` | ||
| git clone --recurse-submodules https://github.com/microsoft/cpp_client_telemetry | ||
| cd cpp_client_telemetry | ||
| vcpkg install --head --overlay-ports=%CD%\tools\ports mstelemetry | ||
| ``` | ||
|
|
||
| ## POSIX (Linux and Mac) build with submodules | ||
|
|
||
| Shell commands: | ||
|
|
||
| ``` | ||
| git clone --recurse-submodules https://github.com/microsoft/cpp_client_telemetry | ||
| cd cpp_client_telemetry | ||
| vcpkg install --head --overlay-ports=`pwd`/tools/ports mstelemetry | ||
| ``` | ||
|
|
||
| ## Using response files to specify dependencies | ||
|
|
||
| vcpkg allows to consolidate parameters passed to vcpkg in a response file. All 3rd party dependencies needed for 1DS SDK can be described and installed via response file. | ||
|
|
||
| Example for Mac: | ||
| ``` | ||
| vcpkg install @tools/ports/mstelemetry/response_file_mac.txt | ||
| ``` | ||
|
|
||
| Example for Linux: | ||
| ``` | ||
| vcpkg install @tools/ports/mstelemetry/response_file_linux.txt | ||
| ``` | ||
|
|
||
| vcpkg build log files are created in `${VCPKG_INSTALL_DIR}/buildtrees/mstelemetry/build-[err|out].log` . Review the logs in case if you encounter package installation failures. | ||
|
|
||
| ## Using triplets | ||
|
|
||
| In order to enable custom build flags - vcpkg triplets and custom environment variables may be used. Please see [triplets instruction here](https://vcpkg.readthedocs.io/en/latest/users/triplets/). Response file for a custom build, e.g. `response_file_linux_PRODUCTNAME.txt` may specify a custom triplet. For example, custom triplet controls if the library is built as static or dynamic. Default triplets may also be overridden with [custom triplets](https://vcpkg.readthedocs.io/en/latest/examples/overlay-triplets-linux-dynamic/#overlay-triplets-example). Custom triplets specific to various products must be maintained by product teams. Product teams may optionally decide to integrate their triplets in the mainline 1DS C++ SDK repo as-needed. | ||
|
|
||
| ## Build with vcpkg dependencies | ||
|
|
||
| This section needs to be updated with more detailed info. Default `CMakeLists.txt` in top-level directory utilize the following dependencies: | ||
| - OS-provided `sqlite3` library. | ||
| - OS-provided `zlib` library. | ||
| - SDK-provided snapshot of `nlohmann-json` header-only library. | ||
|
|
||
| It is possible to adjust the build system to use vcpkg-installed dependencies instead. | ||
|
|
||
| ### nlohmann-json | ||
|
|
||
| The package `nlohmann-json` provides CMake targets: | ||
| ``` | ||
| find_package(nlohmann_json CONFIG REQUIRED) | ||
| target_link_libraries(main PRIVATE nlohmann_json nlohmann_json::nlohmann_json) | ||
| ``` | ||
|
|
||
| ### sqlite3 | ||
|
|
||
| The package `sqlite3` provides CMake targets: | ||
| ``` | ||
| find_package(unofficial-sqlite3 CONFIG REQUIRED) | ||
| target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3) | ||
| ``` | ||
|
|
||
| ### zlib | ||
|
|
||
| The package zlib is compatible with built-in CMake targets: | ||
| ``` | ||
| find_package(ZLIB REQUIRED) | ||
| target_link_libraries(main PRIVATE ZLIB::ZLIB) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| This code was obtained from https://github.com/google/googletest/pull/1029/commits/ba638689e40fc60c2e5194fc777bf30541deeff8 | ||
|
|
||
| It has been approved by CELA for Skype internal use. These bits are not used in production, for internal testing only. | ||
| It has been approved by CELA for internal use. These bits are not used in production, for internal testing only. | ||
|
|
||
| This code must be deprecated and removed, permanently replaced by git submodule located at `third_party/googletest`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #!/bin/sh | ||
| MATSDK_INSTALL_DIR=$1 | ||
| echo "Install SDK to $MATSDK_INSTALL_DIR" | ||
| mkdir -p $MATSDK_INSTALL_DIR/lib/mat | ||
| cp out/lib/libmat.a $MATSDK_INSTALL_DIR/lib | ||
| mkdir -p $MATSDK_INSTALL_DIR/lib | ||
| cp out/lib/libmat.* $MATSDK_INSTALL_DIR/lib | ||
| mkdir -p $MATSDK_INSTALL_DIR/include/mat | ||
| cp lib/include/public/* $MATSDK_INSTALL_DIR/include/mat |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.