Skip to content

Commit 0aa9578

Browse files
committed
Just target for downloading the vcpkg binary
1 parent eb42376 commit 0aa9578

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

vcpkg.just

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# detect the vcpkg triplet based on the system information
22
windows_triplet := "x64-windows-static"
3+
vcpkg_version := "2025-09-03"
4+
vcpkg_tool_url := if os_family() == "windows" {
5+
"https://github.com/microsoft/vcpkg-tool/releases/download/" + vcpkg_version + "/vcpkg.exe"
6+
} else if os() == "macos" {
7+
"https://github.com/microsoft/vcpkg-tool/releases/download/" + vcpkg_version + "/vcpkg-macos"
8+
} else {
9+
"https://github.com/microsoft/vcpkg-tool/releases/download/" + vcpkg_version + "/vcpkg-muslc"
10+
}
11+
312
VCPKG_DEFAULT_TRIPLET := if os_family() == "windows" {
413
windows_triplet
514
} else if os() == "macos" {
@@ -16,6 +25,18 @@ VCPKG_DEFAULT_HOST_TRIPLET := VCPKG_DEFAULT_TRIPLET
1625
vcpkg_root := env('VCPKG_ROOT', join(justfile_directory(), "..", "vcpkg"))
1726
in_git_repo := path_exists(join(justfile_directory(), ".git"))
1827

28+
[windows]
29+
download_vcpkg_bin:
30+
mkdir '{{join(justfile_directory(), "vcpkg")}}'
31+
curl -L --fail --show-error '{{vcpkg_tool_url}}' -o '{{join(justfile_directory(), "vcpkg", "vcpkg.exe")}}'
32+
33+
[unix]
34+
download_vcpkg_bin:
35+
rm -r '{{join(justfile_directory(), "vcpkg")}}'
36+
mkdir -p '{{join(justfile_directory(), "vcpkg")}}'
37+
curl -L --fail --show-error '{{vcpkg_tool_url}}' -o '{{join(justfile_directory(), "vcpkg", "vcpkg")}}'
38+
chmod +x '{{join(justfile_directory(), "vcpkg", "vcpkg")}}'
39+
1940
git_status_clean:
2041
if {{in_git_repo}}; then git diff --quiet --exit-code; fi
2142

0 commit comments

Comments
 (0)