Skip to content

Commit 679d58f

Browse files
authored
ci!: generator/ is no longer built by default in CMake (#6243)
* ci!: generator/ is no longer built by default in CMake Our `generator/` code is an implementation that our users will rarely, if ever, need to build or use directly. So it seems it would be better to not compile it by default in our CMake builds. This PR changes the generator to not be build by default in CMake builds. It also explicitly enables the generator in our clang-tidy builds (kokoro and GCB) so that the generator is checked. All the sanitizer builds use bazel so they will be unaffected. This is technically a breaking change, but it's very unlikely to affect anyone in practice. * adds CHANGELOG entry for this break
1 parent 3e990b5 commit 679d58f

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@
6868

6969
## v1.27.0 - TBD
7070

71+
### Misc.
72+
73+
**BREAKING CHANGES**:
74+
* In #6243 we stopped compiling the code in `generator/` by default in CMake
75+
builds. In most cases this should just be a performance win as this code is
76+
not used by client libraries. However, if anyone was relying on the
77+
`generator/` being compiled, it can be re-enabled with
78+
`-DGOOGLE_CLOUD_CPP_ENABLE_GENERATOR=ON`
79+
7180
## v1.26.0 - 2021-04
7281

7382
### BigQuery

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ option(GOOGLE_CLOUD_CPP_ENABLE_PUBSUB "Enable building the Pub/Sub library." ON)
159159
option(GOOGLE_CLOUD_CPP_ENABLE_IAM "Enable building the IAM library." ON)
160160
option(GOOGLE_CLOUD_CPP_ENABLE_LOGGING "Enable building the Logging library."
161161
ON)
162-
option(GOOGLE_CLOUD_CPP_ENABLE_GENERATOR "Enable building the generator." ON)
162+
option(GOOGLE_CLOUD_CPP_ENABLE_GENERATOR "Enable building the generator." OFF)
163163

164164
# The default list of libraries to build. These can be overridden by the user by
165165
# passing a comma-separated list, i.e
166166
# `-DGOOGLE_CLOUD_CPP_ENABLE=spanner,storage`.
167167
set(GOOGLE_CLOUD_CPP_ENABLE
168-
"bigtable;bigquery;iam;firestore;logging;pubsub;spanner;storage;generator"
168+
"bigtable;bigquery;iam;firestore;logging;pubsub;spanner;storage"
169169
CACHE STRING "The list of libraries to build.")
170170

171171
string(REPLACE "," ";" GOOGLE_CLOUD_CPP_ENABLE "${GOOGLE_CLOUD_CPP_ENABLE}")

ci/cloudbuild/builds/clang-tidy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export CXX=clang++
2424
export CTCACHE_DIR=~/.cache/ctcache
2525

2626
# See https://github.com/matus-chochlik/ctcache for docs about the clang-tidy-cache
27-
cmake -GNinja -DCMAKE_CXX_CLANG_TIDY=/usr/local/bin/clang-tidy-wrapper -S . -B cmake-out
27+
cmake -GNinja -DCMAKE_CXX_CLANG_TIDY=/usr/local/bin/clang-tidy-wrapper \
28+
-DGOOGLE_CLOUD_CPP_ENABLE_GENERATOR=ON \
29+
-S . -B cmake-out
2830
cmake --build cmake-out
2931
env -C cmake-out ctest -LE "integration-test"
3032

ci/kokoro/docker/build-in-docker-cmake.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ if [[ "${BUILD_TESTING:-}" == "no" ]]; then
8686
fi
8787

8888
if [[ "${CLANG_TIDY:-}" == "yes" ]]; then
89+
cmake_extra_flags+=("-DGOOGLE_CLOUD_CPP_ENABLE_GENERATOR=ON")
8990
cmake_extra_flags+=("-DCMAKE_EXPORT_COMPILE_COMMANDS=ON")
9091
# On pre-submit builds we run clang-tidy on only the changed files (see below)
9192
# in other cases (interactive builds, continuous builds) we run clang-tidy as

ci/kokoro/install/Dockerfile.debian-buster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ RUN mkdir -p /h/.ccache; \
125125
fi; \
126126
true # Ignore all errors, failures in caching should not break the build
127127
## [END IGNORED]
128-
RUN cmake -DBUILD_TESTING=OFF -DGOOGLE_CLOUD_CPP_ENABLE_GENERATOR=OFF -H. -Bcmake-out
128+
RUN cmake -DBUILD_TESTING=OFF -H. -Bcmake-out
129129
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
130130
RUN cmake --build cmake-out --target install
131131
# ```

doc/packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ We can now compile, test, and install `google-cloud-cpp`.
10341034

10351035
```bash
10361036
cd $HOME/google-cloud-cpp
1037-
cmake -DBUILD_TESTING=OFF -DGOOGLE_CLOUD_CPP_ENABLE_GENERATOR=OFF -H. -Bcmake-out
1037+
cmake -DBUILD_TESTING=OFF -H. -Bcmake-out
10381038
cmake --build cmake-out -- -j "${NCPU:-4}"
10391039
sudo cmake --build cmake-out --target install
10401040
```

0 commit comments

Comments
 (0)