From 277ce1ddc2e6d8d3687f3f5e3c95ef1db04c787a Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Mon, 29 Aug 2022 16:52:14 -0700 Subject: CMake: Add an option to build the libraries that are used for writing tests without requiring Abseil's tests be built (default=OFF) This disables building libraries that are only used for writing tests by default. The logging library releases some libraries used for writing tests that themselves depend on GoogleTest. This allows Abseil to build by default without requiring GoogleTest. Fixes #1262 PiperOrigin-RevId: 470847215 Change-Id: I296f41aa06d6f302853af3f32e1f762649504afc --- CMake/AbseilHelpers.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CMake') diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index 3fb86375..e3194bcf 100644 --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake @@ -97,8 +97,9 @@ function(absl_cc_library) ${ARGN} ) - if(NOT ABSL_CC_LIB_PUBLIC AND ABSL_CC_LIB_TESTONLY AND - NOT (BUILD_TESTING AND ABSL_BUILD_TESTING)) + if(ABSL_CC_LIB_TESTONLY AND + NOT ((BUILD_TESTING AND ABSL_BUILD_TESTING) OR + (ABSL_BUILD_TEST_HELPERS AND ABSL_CC_LIB_PUBLIC))) return() endif() -- cgit v1.2.3