build: bundle vcpkg as a git submodule, pinned to the manifest baseline
Adds vcpkg as a submodule at vcpkg/, pinned to the exact commit vcpkg.json already declares as builtin-baseline, so the bundled checkout and the manifest's resolved port versions can never drift apart. cmake/voicecat-toolchain.cmake, scripts/common.sh, and clients/apple/scripts/build-xcframework.sh now resolve vcpkg as: VCPKG_ROOT env var (external checkout) > bundled submodule. Docs updated to describe the new one-time setup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,10 +79,10 @@ vc_require_windows() {
|
||||
}
|
||||
|
||||
# ── VCPKG_ROOT ──────────────────────────────────────────────────────────────────
|
||||
# Honor the env var, else try to read it from an existing CMake cache
|
||||
# (Z_VCPKG_ROOT_DIR) so a developer who already configured a preset doesn't need
|
||||
# VCPKG_ROOT in their shell env. $1 = the preset whose cache to probe as a
|
||||
# fallback (e.g. "dev" or "apple-dev").
|
||||
# Resolution order: the env var, else an existing CMake cache (Z_VCPKG_ROOT_DIR) so a
|
||||
# developer who already configured a preset doesn't need VCPKG_ROOT in their shell env,
|
||||
# else the bundled submodule at <repo-root>/vcpkg. $1 = the preset whose cache to probe
|
||||
# as a fallback (e.g. "dev" or "apple-dev").
|
||||
vc_resolve_vcpkg_root() {
|
||||
local fallback_preset="${1:-dev}"
|
||||
if [[ -z "${VCPKG_ROOT:-}" ]]; then
|
||||
@@ -95,9 +95,17 @@ vc_resolve_vcpkg_root() {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ -z "${VCPKG_ROOT:-}" ]]; then
|
||||
local bundled="$VC_REPO_ROOT/vcpkg"
|
||||
if [[ -f "$bundled/scripts/buildsystems/vcpkg.cmake" ]]; then
|
||||
export VCPKG_ROOT="$bundled"
|
||||
fi
|
||||
fi
|
||||
if [[ -z "${VCPKG_ROOT:-}" || ! -d "$VCPKG_ROOT" ]]; then
|
||||
vc_die "VCPKG_ROOT is not set or does not exist.
|
||||
bootstrap vcpkg (https://vcpkg.io) then:
|
||||
either init the bundled submodule:
|
||||
git submodule update --init vcpkg
|
||||
or point at an external vcpkg checkout:
|
||||
export VCPKG_ROOT=/path/to/vcpkg"
|
||||
fi
|
||||
vc_log "VCPKG_ROOT=$VCPKG_ROOT"
|
||||
|
||||
Reference in New Issue
Block a user