Skip to content

Commit b49ec83

Browse files
committed
Do not require a functional vcpkg during CMake process
Allows to simplify vendoring for offline build. Toolchain configuration set from build scripts where vcpkg is already used.
1 parent c1c68ec commit b49ec83

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

internal/frontend/bridge-gui/BridgeSetup.cmake

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ endif()
5353

5454
set(VCPKG_ROOT "${BRIDGE_REPO_ROOT}/extern/vcpkg")
5555
message(STATUS "VCPKG_ROOT is ${VCPKG_ROOT}")
56-
if (WIN32)
57-
find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg.exe")
58-
else()
59-
find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg")
60-
endif()
61-
if (NOT VCPKG_EXE)
62-
message(FATAL_ERROR "vcpkg is not installed. Run build.sh (macOS/Linux) or build.ps1 (Windows) first.")
63-
endif()
6456

6557
# For now we support only a single architecture for macOS (ARM64 or x86_64). We need to investigate how to build universal binaries with vcpkg.
6658
if (APPLE)
@@ -86,5 +78,3 @@ if (WIN32)
8678
message(STATUS "Building for Intel x64 Windows computers")
8779
set(VCPKG_TARGET_TRIPLET x64-windows)
8880
endif()
89-
90-
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain")

internal/frontend/bridge-gui/bridge-gui/build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ $buildDir=(Join-Path $scriptDir "cmake-build-$buildConfig".ToLower())
6363
$vcpkgRoot = (Join-Path $bridgeRepoRootDir "extern/vcpkg" -Resolve)
6464
$vcpkgExe = (Join-Path $vcpkgRoot "vcpkg.exe")
6565
$vcpkgBootstrap = (Join-Path $vcpkgRoot "bootstrap-vcpkg.bat")
66+
$vcpkgToolchain = (Join-Path $vcpkgRoot "scripts/buildsystems/vcpkg.cmake")
6667

6768
function check_exit() {
6869
if ($? -ne $True)
@@ -91,6 +92,7 @@ git submodule update --init --recursive $vcpkgRoot
9192
. $vcpkgExe install sentry-native:x64-windows grpc:x64-windows --clean-after-build
9293
. $vcpkgExe upgrade --no-dry-run
9394
. $cmakeExe -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE="$buildConfig" `
95+
-DCMAKE_TOOLCHAIN_FILE="$vcpkgToolchain" `
9496
-DBRIDGE_APP_FULL_NAME="$bridgeFullName" `
9597
-DBRIDGE_VENDOR="$bridgeVendor" `
9698
-DBRIDGE_REVISION="$REVISION_HASH" `

internal/frontend/bridge-gui/bridge-gui/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ fi
9595

9696
cmake \
9797
-DCMAKE_BUILD_TYPE="${BUILD_CONFIG}" \
98+
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
9899
-DBRIDGE_APP_FULL_NAME="${BRIDGE_APP_FULL_NAME}" \
99100
-DBRIDGE_VENDOR="${BRIDGE_VENDOR}" \
100101
-DBRIDGE_REVISION="${BRIDGE_REVISION}" \

0 commit comments

Comments
 (0)