From 6708f425da86a79888e7a7e30a5fd92c23b079df Mon Sep 17 00:00:00 2001 From: dbolduc Date: Sun, 4 Feb 2024 01:48:42 -0500 Subject: [PATCH 1/2] feat(bigtable): install mocks library --- ci/etc/expected_install_directories | 1 + ci/verify_current_targets/CMakeLists.txt | 1 + generator/standalone_main.cc | 1 - google/cloud/bigtable/CMakeLists.txt | 4 ++-- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/etc/expected_install_directories b/ci/etc/expected_install_directories index a7f2a2b3b6c83..eeadaf1e80847 100644 --- a/ci/etc/expected_install_directories +++ b/ci/etc/expected_install_directories @@ -1228,6 +1228,7 @@ ./lib64/cmake/google_cloud_cpp_bigquery ./lib64/cmake/google_cloud_cpp_bigquery_mocks ./lib64/cmake/google_cloud_cpp_bigtable +./lib64/cmake/google_cloud_cpp_bigtable_mocks ./lib64/cmake/google_cloud_cpp_billing ./lib64/cmake/google_cloud_cpp_billing_mocks ./lib64/cmake/google_cloud_cpp_binaryauthorization diff --git a/ci/verify_current_targets/CMakeLists.txt b/ci/verify_current_targets/CMakeLists.txt index a3adb341f91b2..c1ec5884592a7 100644 --- a/ci/verify_current_targets/CMakeLists.txt +++ b/ci/verify_current_targets/CMakeLists.txt @@ -26,6 +26,7 @@ set(ga_libraries # cmake-format: sort bigquery bigtable + bigtable_mocks iam iam_mocks logging diff --git a/generator/standalone_main.cc b/generator/standalone_main.cc index cde111d1f4d37..11b58702ae53e 100644 --- a/generator/standalone_main.cc +++ b/generator/standalone_main.cc @@ -169,7 +169,6 @@ int WriteInstallDirectories( install_directories.push_back("./lib64/cmake/google_cloud_cpp_" + lib); // TODO(#5782) - install mocks in libs with handwritten CMakeLists.txt auto const handwritten_cmake = std::set{{ - "bigtable", "compute", "storage", }}; diff --git a/google/cloud/bigtable/CMakeLists.txt b/google/cloud/bigtable/CMakeLists.txt index c0155804b4cbd..94edc6f986cd1 100644 --- a/google/cloud/bigtable/CMakeLists.txt +++ b/google/cloud/bigtable/CMakeLists.txt @@ -512,8 +512,6 @@ install( google_cloud_cpp_install_headers("google_cloud_cpp_bigtable" "include/google/cloud/bigtable") -google_cloud_cpp_install_headers("google_cloud_cpp_bigtable_mocks" - "include/google/cloud/bigtable") google_cloud_cpp_add_pkgconfig( bigtable @@ -537,3 +535,5 @@ install( "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_bigtable-config-version.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_bigtable" COMPONENT google_cloud_cpp_development) + +google_cloud_cpp_install_mocks(bigtable "Google Cloud Bigtable") From 33f7be130554dae6cffbb3c38eccbcb27ebb3970 Mon Sep 17 00:00:00 2001 From: dbolduc Date: Sun, 4 Feb 2024 02:28:39 -0500 Subject: [PATCH 2/2] uh, idgi --- generator/standalone_main.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/generator/standalone_main.cc b/generator/standalone_main.cc index 11b58702ae53e..a3b6749e4c279 100644 --- a/generator/standalone_main.cc +++ b/generator/standalone_main.cc @@ -20,7 +20,6 @@ #include "generator/internal/scaffold_generator.h" #include "google/cloud/internal/absl_str_cat_quiet.h" #include "google/cloud/internal/absl_str_join_quiet.h" -#include "google/cloud/internal/algorithm.h" #include "google/cloud/log.h" #include "google/cloud/status_or.h" #include "absl/flags/flag.h" @@ -167,12 +166,10 @@ int WriteInstallDirectories( } auto const lib = LibraryName(product_path); install_directories.push_back("./lib64/cmake/google_cloud_cpp_" + lib); - // TODO(#5782) - install mocks in libs with handwritten CMakeLists.txt - auto const handwritten_cmake = std::set{{ - "compute", - "storage", - }}; - if (!google::cloud::internal::Contains(handwritten_cmake, lib)) { + // Note that storage does not have a public-facing mocks library. Only + // GCS+gRPC does. + // TODO(#5782) - install mocks for compute + if (lib != "compute" && lib != "storage") { install_directories.push_back("./lib64/cmake/google_cloud_cpp_" + lib + "_mocks"); }