google-cloud-cpp icon indicating copy to clipboard operation
google-cloud-cpp copied to clipboard

The google-cloud-cpp::*-mocks targets are not exported

Open coryan opened this issue 4 years ago • 5 comments

These targets are not exported. In practice it does not matter much, because using the library gets you the same -I flags, but the applications are missing the -lgtest* and -lgmock* options.

We need to fix at least the following problems:

  • [ ] We need to separate the CMake and pkg-config files for mocks vs. runtime libraries. If we add the mocks to the existing config files then we need to add find_dependency(gtest) (and its equivalent in pkg-config lingo) to the config files. It would be very strange to require googletest when all you want is to link against the runtime version of the libraries.
  • [ ] We need to decide if installing these libraries is optional or not. I think we should not make it optional, we have too many knobs already.
  • [ ] We need to install these libraries as part of the "development" component (for CMake)
  • [ ] We need to add something to the CI builds to verify these libraries are usable once installed.

coryan avatar Jan 30 '21 20:01 coryan

We need to revisit this in 2022-06 when we will drop CMake 3.5.

coryan avatar Feb 24 '22 19:02 coryan

I will try to do this on my next operator week.

coryan avatar Jul 21 '22 18:07 coryan

Soon (2023-05-01) we will drop CMake 3.10 and I think this gets easier.

coryan avatar Apr 26 '23 18:04 coryan

Only compute remains. We probably want to install all compute_<resource>_mocks in a google_cloud_cpp_compute_mocks module.

If we want to use the helper, we would need to generalize it.

Unassigning because my operator shift is over.

dbolduc avatar Feb 06 '24 18:02 dbolduc