Skip to content

Commit 5abfe1f

Browse files
teo-tsirpaniscenit
authored andcommitted
[google-cloud-cpp] Skip building mock libraries. (microsoft#39802)
1 parent b8e10e4 commit 5abfe1f

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index e1a1dc8..807f6e2 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -173,7 +173,7 @@ provided mocks to test code involving the Cloud C++ clients may wish to turn
6+
this flag off.]==]
7+
ON
8+
"NOT BUILD_TESTING"
9+
- ON)
10+
+ $<IF:$<BOOL:${BUILD_TESTING}>:OFF:ON>)
11+
mark_as_advanced(GOOGLE_CLOUD_CPP_WITH_MOCKS)
12+
13+
# The examples use exception handling to simplify the code. Therefore they
14+
@@ -246,7 +246,7 @@ include(CTest)
15+
# used in the depends condition of the next option.
16+
include(EnableCxxExceptions)
17+
18+
-if (BUILD_TESTING)
19+
+if (BUILD_TESTING OR GOOGLE_CLOUD_CPP_WITH_MOCKS)
20+
# Discover and add targets for the GTest::gtest and GTest::gmock libraries.
21+
include(FindGMockWithTargets)
22+
endif ()

ports/google-cloud-cpp/portfile.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ vcpkg_from_github(
88
HEAD_REF main
99
PATCHES
1010
support_absl_cxx17.patch
11+
fix_mocks_dependent_option.patch
1112
)
1213

1314
if ("grpc-common" IN_LIST FEATURES)
@@ -48,6 +49,7 @@ vcpkg_cmake_configure(
4849
-DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF
4950
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF
5051
-DBUILD_TESTING=OFF
52+
-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF
5153
)
5254

5355
vcpkg_cmake_install()

ports/google-cloud-cpp/vcpkg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "google-cloud-cpp",
33
"version": "2.26.0",
4+
"port-version": 1,
45
"description": "C++ Client Libraries for Google Cloud Platform APIs.",
56
"homepage": "https://github.com/googleapis/google-cloud-cpp",
67
"license": "Apache-2.0",

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,7 @@
31543154
},
31553155
"google-cloud-cpp": {
31563156
"baseline": "2.26.0",
3157-
"port-version": 0
3157+
"port-version": 1
31583158
},
31593159
"google-cloud-cpp-common": {
31603160
"baseline": "alias",

versions/g-/google-cloud-cpp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "79809a3d4f368d9afe5eac6f10d892311b464e00",
5+
"version": "2.26.0",
6+
"port-version": 1
7+
},
38
{
49
"git-tree": "6f92046f144ea5804abafe724ea2fec115dad148",
510
"version": "2.26.0",

0 commit comments

Comments
 (0)