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:
@@ -17,7 +17,9 @@
|
||||
# in their cacheVariables; the DEFINED guards below preserve those. VCPKG_HOST_TRIPLET
|
||||
# is always the host's (e.g. arm64-osx when cross-compiling iOS on Apple Silicon).
|
||||
#
|
||||
# Requires VCPKG_ROOT in the environment (set by the inheriting preset).
|
||||
# Resolution order: an explicit VCPKG_ROOT env var always wins (for developers pointing at
|
||||
# their own external vcpkg checkout); otherwise this falls back to the bundled submodule at
|
||||
# <repo-root>/vcpkg (`git submodule update --init vcpkg`).
|
||||
|
||||
# ── Host triplet (the platform running vcpkg / the build) ─────────────────────
|
||||
if(NOT DEFINED VCPKG_HOST_TRIPLET)
|
||||
@@ -78,5 +80,21 @@ if(NOT DEFINED VCPKG_OVERLAY_TRIPLETS)
|
||||
CACHE STRING "vcpkg overlay triplets directory")
|
||||
endif()
|
||||
|
||||
# ── Resolve vcpkg root ──────────────────────────────────────────────────────────
|
||||
if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "")
|
||||
set(_voicecat_vcpkg_root "$ENV{VCPKG_ROOT}")
|
||||
else()
|
||||
set(_voicecat_vcpkg_root "${CMAKE_CURRENT_LIST_DIR}/../vcpkg")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${_voicecat_vcpkg_root}/scripts/buildsystems/vcpkg.cmake")
|
||||
message(FATAL_ERROR
|
||||
"vcpkg not found at '${_voicecat_vcpkg_root}'.\n"
|
||||
"Either init the bundled submodule:\n"
|
||||
" git submodule update --init vcpkg\n"
|
||||
"or point VCPKG_ROOT at an external vcpkg checkout.")
|
||||
endif()
|
||||
|
||||
# ── Hand off to the real vcpkg toolchain ──────────────────────────────────────
|
||||
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
|
||||
include("${_voicecat_vcpkg_root}/scripts/buildsystems/vcpkg.cmake")
|
||||
unset(_voicecat_vcpkg_root)
|
||||
|
||||
Reference in New Issue
Block a user