From 806f38c434fd544f080865688055f36f68732b62 Mon Sep 17 00:00:00 2001 From: "l.feng" <43399351+msclock@users.noreply.github.com> Date: Wed, 25 Dec 2024 09:36:40 +0800 Subject: [PATCH] perf: simplify vcpkg_configure (#22) Signed-off-by: l.feng <43399351+msclock@users.noreply.github.com> --- template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake | 4 ++++ template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake b/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake index c697a0c..5546f78 100644 --- a/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake +++ b/template/cmake/vcpkg/bootstrap/vcpkg_bootstrap.cmake @@ -188,6 +188,10 @@ function(_vcpkg_bootstrap) "${arg_UNPARSED_ARGUMENTS}") endif() + if(NOT DEFINED arg_REPO) + set(arg_REPO https://github.com/microsoft/vcpkg.git) + endif() + find_package(Git QUIET REQUIRED) if(DEFINED CACHE{_VCPKG_ROOT}) diff --git a/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja b/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja index acf91aa..ae52534 100644 --- a/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja +++ b/template/cmake/vcpkg/vcpkg.toolchain.cmake.jinja @@ -27,5 +27,4 @@ set(VCPKG_VERBOSE file(READ ${CMAKE_SOURCE_DIR}/vcpkg.json _vcpkg_json) string(JSON _builtin_baseline GET ${_vcpkg_json} builtin-baseline) -vcpkg_configure(CACHE_DIR_NAME {{ ss_cmake_repo_name}} REPO - https://github.com/microsoft/vcpkg.git REF ${_builtin_baseline}) +vcpkg_configure(CACHE_DIR_NAME {{ ss_cmake_repo_name}} REF ${_builtin_baseline})