Skip to content

Commit ad3da8f

Browse files
authored
fix: correct check for storage vs. rest enabled (#8855)
We cannot enable the storage library and disable the `rest-internal` library, unfortunately the check was based on the wrong variables.
1 parent 696df47 commit ad3da8f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ For status on this, see https://github.com/googleapis/google-cloud-cpp/issues/88
8484

8585
## v1.41.0 - TBD
8686

87+
## v1.40.1 - 2022-05
88+
89+
* fix: correct check for storage vs. rest enabled ([#8850](https://github.com/googleapis/google-cloud-cpp/pull/8850))
90+
8791
## v1.40.0 - 2022-05
8892

8993
We are happy to announce that the following GA libraries. Unless specifically

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,19 @@ cmake_dependent_option(
272272
ON "GOOGLE_CLOUD_CPP_ENABLE_REST_EXPRESSION" OFF)
273273
mark_as_advanced(GOOGLE_CLOUD_CPP_ENABLE_REST)
274274

275-
# Prevent users for setting incompatible flags.
276-
if (GOOGLE_CLOUD_CPP_ENABLE_STORAGE AND NOT GOOGLE_CLOUD_CPP_ENABLE_REST)
275+
# Detect incompatible flags and let the customer know what to do.
276+
if (storage IN_LIST GOOGLE_CLOUD_CPP_ENABLE AND NOT
277+
GOOGLE_CLOUD_CPP_ENABLE_REST)
277278
message(
278279
FATAL_ERROR
279-
"If storage is enabled (e.g. -DGOOGLE_CLOUD_ENABLE=storage), "
280-
"the REST library cannot be disabled "
281-
"(e.g. -DGOOGLE_CLOUD_CPP_ENABLE_REST=OFF)")
280+
"If storage is enabled (e.g. -DGOOGLE_CLOUD_CPP_ENABLE=storage),"
281+
" the REST library cannot be disabled,"
282+
" i.e., you cannot set -DGOOGLE_CLOUD_CPP_ENABLE_REST=OFF."
283+
" If you do want to use the storage library,"
284+
" then do not use -DGOOGLE_CLOUD_CPP_ENABLE_REST=OFF."
285+
" If you do not want to use the storage library,"
286+
" then provide a -DGOOGLE_CLOUD_CPP_ENABLE=... list and do not"
287+
" include storage in that list.")
282288
endif ()
283289

284290
# Enable testing in this directory so we can do a top-level `make test`. This

0 commit comments

Comments
 (0)