-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
describe how to use msys2 packages on Windows
- Loading branch information
1 parent
9f195bb
commit ca8bc4d
Showing
11 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,34 @@ | ||
# How to Avoid Building All Dependencies with vcpkg | ||
|
||
vcpkg supports a trick that lets toy get a dependency from an external source (like a package manager) instead of | ||
building it. The only explanation of the trick that I've seen is a [blog post from microsoft], but I've put it to | ||
use it on Linux (with apt/dnf dependencies), macOS (homebrew), and Windows (msys2). | ||
|
||
You can probably get away with using a different package manager, as long as the packages that it installs are | ||
registered with the pkg-config that your build uses. I've been getting pkg-config from msys2 on Windows, so I | ||
stayed with msys2 for the dependency packages as well. I imagine chocolatey would work too if that's your thing. | ||
|
||
Anyway, here's what worked for me: | ||
|
||
1. Install [msys2](https://www.msys2.org) | ||
|
||
2. Install pkg-config and ziti-tunnel-sdk-c dependencies from an `msys2` prompt: | ||
|
||
pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-json-c mingw-w64-x86_64-libuv \ | ||
mingw-w64-x86_64-libsodium mingw-w64-x86_64-openssl | ||
|
||
3. Add `c:\msys64\mingw64\bin` to your PATH. | ||
|
||
4. Add the following to your cmake preset: | ||
|
||
"cacheVariables": { | ||
"VCPKG_OVERLAY_PORTS": "${sourceDir}/vcpkg-overlays/full-distro/windows-11" | ||
}, | ||
"environment": { | ||
"OPENSSL_ROOT_DIR": "c:/msys64/mingw64" | ||
}, | ||
|
||
The openssl variable was needed because [cmake's FindOpenSSL module](https://cmake.org/cmake/help/latest/module/FindOpenSSL.html) | ||
does not consult `pkg-config` on Windows. | ||
|
||
5. Remove your build directory, and re-run cmake. |
This file contains 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 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains 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,4 @@ | ||
{ | ||
"name": "json-c", | ||
"version": "0" | ||
} |
This file contains 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 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains 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,4 @@ | ||
{ | ||
"name": "libsodium", | ||
"version": "0" | ||
} |
This file contains 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 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains 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,4 @@ | ||
{ | ||
"name": "libuv", | ||
"version": "0" | ||
} |
This file contains 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 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains 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,4 @@ | ||
{ | ||
"name": "openssl", | ||
"version": "0" | ||
} |
1 change: 1 addition & 0 deletions
1
vcpkg-overlays/full-distro/windows-11/protobuf-c/portfile.cmake
This file contains 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 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
This file contains 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,4 @@ | ||
{ | ||
"name": "protobuf-c", | ||
"version": "0" | ||
} |