[google-cloud-cpp] Skip building mock libraries. (#39802)

This commit is contained in:
Theodore Tsirpanis 2024-07-10 17:14:13 +03:00 committed by GitHub
parent 1b5f734661
commit 3389f5011d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e1a1dc8..807f6e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -173,7 +173,7 @@ provided mocks to test code involving the Cloud C++ clients may wish to turn
this flag off.]==]
ON
"NOT BUILD_TESTING"
- ON)
+ $<IF:$<BOOL:${BUILD_TESTING}>:OFF:ON>)
mark_as_advanced(GOOGLE_CLOUD_CPP_WITH_MOCKS)
# The examples use exception handling to simplify the code. Therefore they
@@ -246,7 +246,7 @@ include(CTest)
# used in the depends condition of the next option.
include(EnableCxxExceptions)
-if (BUILD_TESTING)
+if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_WITH_MOCKS)
# Discover and add targets for the GTest::gtest and GTest::gmock libraries.
include(FindGMockWithTargets)
endif ()

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF main
PATCHES
support_absl_cxx17.patch
fix_mocks_dependent_option.patch
)
if ("grpc-common" IN_LIST FEATURES)
@ -48,6 +49,7 @@ vcpkg_cmake_configure(
-DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF
)
vcpkg_cmake_install()

View File

@ -1,6 +1,7 @@
{
"name": "google-cloud-cpp",
"version": "2.26.0",
"port-version": 1,
"description": "C++ Client Libraries for Google Cloud Platform APIs.",
"homepage": "https://github.com/googleapis/google-cloud-cpp",
"license": "Apache-2.0",

View File

@ -3154,7 +3154,7 @@
},
"google-cloud-cpp": {
"baseline": "2.26.0",
"port-version": 0
"port-version": 1
},
"google-cloud-cpp-common": {
"baseline": "alias",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "79809a3d4f368d9afe5eac6f10d892311b464e00",
"version": "2.26.0",
"port-version": 1
},
{
"git-tree": "6f92046f144ea5804abafe724ea2fec115dad148",
"version": "2.26.0",