Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Googletest: should only download if explicitly requested #376

Open
hzeller opened this issue Mar 1, 2025 · 3 comments
Open

Googletest: should only download if explicitly requested #376

hzeller opened this issue Mar 1, 2025 · 3 comments

Comments

@hzeller
Copy link
Contributor

hzeller commented Mar 1, 2025

Currently, Googletest is attempted to be downloaded unconditionally if tests are enabled

https://github.com/berkeley-abc/abc/blob/master/CMakeLists.txt#L116-L128

This is problematic for packaging, as

  • in packaging context,s, the build is not allowed to connect to the 'net
  • it is preferred to use the system-provided library.

So I suggest to only do that on some explicit, say -DABC_DOWNLOAD_GTEST, default false; by default it should just use the default googletest available on the system (1.14.0 is old enough that it should be available on all distros. ) using the include(GoogleTest) macro in CMake.

I see if I can get to it.

@hzeller
Copy link
Contributor Author

hzeller commented Mar 1, 2025

Ah, just looking at git annotate... ohai @QuantamHD :)

@QuantamHD
Copy link
Contributor

Why not download by default, and turn off if you're trying to package it? IMO we should optimize for dev velocity over packaging velocity

@hzeller
Copy link
Contributor Author

hzeller commented Mar 1, 2025

IMHO is an antipattern. Developers who care do not want that, in particular the kind that like velocity :)
(also, it would always download stuff on next clean). If there should be some sort of rigid dependency, it should be a third_party/ submodule of sorts (also an antipattern, but slightly less worse).

Anyway, independent of the default, we first need an option to actually be able to choose, before we can define its default :)
I suggest something like -DABC_USE_SYSTEM_GTEST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants