diff --git a/internal/frontend/bridge-gui/BridgeSetup.cmake b/internal/frontend/bridge-gui/BridgeSetup.cmake index 7c6c634c..a6471667 100644 --- a/internal/frontend/bridge-gui/BridgeSetup.cmake +++ b/internal/frontend/bridge-gui/BridgeSetup.cmake @@ -53,14 +53,6 @@ endif() set(VCPKG_ROOT "${BRIDGE_REPO_ROOT}/extern/vcpkg") message(STATUS "VCPKG_ROOT is ${VCPKG_ROOT}") -if (WIN32) - find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg.exe") -else() - find_program(VCPKG_EXE "${VCPKG_ROOT}/vcpkg") -endif() -if (NOT VCPKG_EXE) - message(FATAL_ERROR "vcpkg is not installed. Run build.sh (macOS/Linux) or build.ps1 (Windows) first.") -endif() # 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. if (APPLE) @@ -86,5 +78,3 @@ if (WIN32) message(STATUS "Building for Intel x64 Windows computers") set(VCPKG_TARGET_TRIPLET x64-windows) endif() - -set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "toolchain") \ No newline at end of file diff --git a/internal/frontend/bridge-gui/bridge-gui/build.ps1 b/internal/frontend/bridge-gui/bridge-gui/build.ps1 index 2534dd5d..5b54b8d0 100644 --- a/internal/frontend/bridge-gui/bridge-gui/build.ps1 +++ b/internal/frontend/bridge-gui/bridge-gui/build.ps1 @@ -63,6 +63,7 @@ $buildDir=(Join-Path $scriptDir "cmake-build-$buildConfig".ToLower()) $vcpkgRoot = (Join-Path $bridgeRepoRootDir "extern/vcpkg" -Resolve) $vcpkgExe = (Join-Path $vcpkgRoot "vcpkg.exe") $vcpkgBootstrap = (Join-Path $vcpkgRoot "bootstrap-vcpkg.bat") +$vcpkgToolchain = (Join-Path $vcpkgRoot "scripts/buildsystems/vcpkg.cmake") function check_exit() { if ($? -ne $True) @@ -91,6 +92,7 @@ git submodule update --init --recursive $vcpkgRoot . $vcpkgExe install sentry-native:x64-windows grpc:x64-windows --clean-after-build . $vcpkgExe upgrade --no-dry-run . $cmakeExe -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE="$buildConfig" ` + -DCMAKE_TOOLCHAIN_FILE="$vcpkgToolchain" ` -DBRIDGE_APP_FULL_NAME="$bridgeFullName" ` -DBRIDGE_VENDOR="$bridgeVendor" ` -DBRIDGE_REVISION="$REVISION_HASH" ` diff --git a/internal/frontend/bridge-gui/bridge-gui/build.sh b/internal/frontend/bridge-gui/bridge-gui/build.sh index c299d5ce..9b5e9d22 100755 --- a/internal/frontend/bridge-gui/bridge-gui/build.sh +++ b/internal/frontend/bridge-gui/bridge-gui/build.sh @@ -95,6 +95,7 @@ fi cmake \ -DCMAKE_BUILD_TYPE="${BUILD_CONFIG}" \ + -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \ -DBRIDGE_APP_FULL_NAME="${BRIDGE_APP_FULL_NAME}" \ -DBRIDGE_VENDOR="${BRIDGE_VENDOR}" \ -DBRIDGE_REVISION="${BRIDGE_REVISION}" \ diff --git a/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt b/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt index f4a0a553..018b2ca5 100644 --- a/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt +++ b/internal/frontend/bridge-gui/bridgepp/CMakeLists.txt @@ -174,14 +174,16 @@ endif () include(FetchContent) FetchContent_Declare( - googletest + GTest URL https://github.com/google/googletest/archive/b796f7d44681514f58a683a3a71ff17c94edb0c1.zip + FIND_PACKAGE_ARGS ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +set(INSTALL_GTEST OFF) -FetchContent_MakeAvailable(googletest) +FetchContent_MakeAvailable(GTest) enable_testing()