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

cmake: add ABSL_BUILD_TESTING option #1057

Merged
merged 1 commit into from
Dec 10, 2021
Merged

Conversation

matta
Copy link
Contributor

@matta matta commented Nov 10, 2021

Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
Previous to that, Abseil had a project specific flag for
this, as is the typical idom used in other projects.

BUILD_TESTING is a simplistic all-or-nothing policy that
suffices for simpler projects. When Abseil is incorporated
as a subproject, the encompasing build has no convenient way
to disable just Abseil's tests by default, yet enable its
own.

Fixes #1056

@google-cla google-cla bot added the cla: yes label Nov 10, 2021
@matta matta force-pushed the master branch 2 times, most recently from 55db3de to 59edbc8 Compare November 10, 2021 23:54
Abseil's own tests now are disabled if either BUILD_TESTING
or a new option called ABSL_BUILD_TESTING is false.
Additionally, Abseil's CMakeLists.txt no longer re-declares
the BUILD_TESTING option with a value of false.

Abseil had been using just the BUILD_TESTING option, since
the fix for abseil#901.  Because setting BUILD_TESTING false still
works to disable Abseil's tests, this change preserves the
behavior asked for in that issue.

Previous to that, Abseil had a project specific flag for
this, as is the typical idiom used in other projects.

The issue with BUILD_TESTING is that it is an all-or-nothing
policy.  When Abseil is incorporated as a subproject, the
encompasing project has no convenient way to enable its own
tests while disabling Abseil's.

Fixes abseil#1056
@ipopov
Copy link

ipopov commented Dec 13, 2021

Greetings!

JFYI, the "getting started" instructions on abseil.io still direct users to use -DBUILD_TESTING=on to get started running abseil's tests: https://abseil.io/docs/cpp/quickstart-cmake#getting-the-abseil-code.

I'm not sure the abseil.github.io repo is accepting pull requests; so figured I'd let you know here.

@derekmauro
Copy link
Member

Greetings!

JFYI, the "getting started" instructions on abseil.io still direct users to use -DBUILD_TESTING=on to get started running abseil's tests: https://abseil.io/docs/cpp/quickstart-cmake#getting-the-abseil-code.

I'm not sure the abseil.github.io repo is accepting pull requests; so figured I'd let you know here.

See #1079 - I've submitted a docs update. It should make it to GitHub soon.

Copy link

@tang88888888 tang88888888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@tang88888888 tang88888888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

cmake: Controlling Abseil's tests with BUILD_TESTING is inconvenient
4 participants