Skip to content

Commit a8aaa31

Browse files
authored
ci: enable rest and ud libs when building samples in cmake (#15829)
1 parent 253d756 commit a8aaa31

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmake/GoogleCloudCppFeatures.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,13 @@ macro (google_cloud_cpp_enable_cleanup)
403403
set(GOOGLE_CLOUD_CPP_ENABLE_REST ON)
404404
endif ()
405405

406+
# We need the REST libraries for the full suite of samples.
407+
if (NOT GOOGLE_CLOUD_CPP_ENABLE_REST
408+
AND BUILD_TESTING
409+
AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
410+
set(GOOGLE_CLOUD_CPP_ENABLE_REST ON)
411+
endif ()
412+
406413
list(REMOVE_DUPLICATES GOOGLE_CLOUD_CPP_ENABLE)
407414
endmacro ()
408415

google/cloud/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ if (GOOGLE_CLOUD_CPP_ENABLE_REST AND GOOGLE_CLOUD_CPP_ENABLE_GRPC)
6868
)
6969
endif ()
7070

71-
if (universe_domain IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
71+
# We need the universe_domain library for the full suite of samples if it isn't
72+
# already enabled.
73+
if (universe_domain IN_LIST GOOGLE_CLOUD_CPP_ENABLE
74+
OR BUILD_TESTING
75+
AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
7276
include(
7377
"${CMAKE_CURRENT_SOURCE_DIR}/google_cloud_cpp_universe_domain.cmake")
7478
add_subdirectory(universe_domain)

0 commit comments

Comments
 (0)