Skip to content

Enable Abseil and RE2 integration for GoogleTest in CMake builds. - #1300

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_994040837
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_994040837

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Enable Abseil and RE2 integration for GoogleTest in CMake builds.

googletest must be fetched before abseil-cpp because ABSL_BUILD_TEST_HELPERS=ON checks TARGET gtest at configure time, preventing GTEST_HAS_ABSL=ON from being configured during FetchContent_MakeAvailable(googletest). Without GTEST_HAS_ABSL=1, GoogleTest falls back to POSIX ERE instead of RE2 for MatchesRegex (breaking logging_test) and omits Abseil failure signal handler support (breaking AllocationGuard.CooperativeDeathTest).

Remove FIND_PACKAGE_ARGS NAMES GTest so googletest is always built from source, configure gtest with GTEST_HAS_ABSL=1 and link its Abseil and RE2 dependencies after re2 is fetched, and set GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1 in TCMALLOC_TEST_ENV to match .bazelrc.

googletest must be fetched before abseil-cpp because ABSL_BUILD_TEST_HELPERS=ON checks TARGET gtest at configure time, preventing GTEST_HAS_ABSL=ON from being configured during FetchContent_MakeAvailable(googletest). Without GTEST_HAS_ABSL=1, GoogleTest falls back to POSIX ERE instead of RE2 for MatchesRegex (breaking logging_test) and omits Abseil failure signal handler support (breaking AllocationGuard.CooperativeDeathTest).

Remove FIND_PACKAGE_ARGS NAMES GTest so googletest is always built from source, configure gtest with GTEST_HAS_ABSL=1 and link its Abseil and RE2 dependencies after re2 is fetched, and set GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1 in TCMALLOC_TEST_ENV to match .bazelrc.

PiperOrigin-RevId: 994040837

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant