cmake: make `random_mocking_bit_gen` library public. (#1084)

An external project may depend on an Abseil `TESTONLY` library like
`absl::random_mocking_bit_gen`.  Such a library should not be excluded
from build when Abseil's own tests are not built.

fixes #997
pull/1095/head
Andrei Polushin 3 years ago committed by GitHub
parent 294166fcbe
commit 4799f6225a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CMake/AbseilHelpers.cmake
  2. 1
      absl/random/CMakeLists.txt

@ -83,7 +83,8 @@ function(absl_cc_library)
${ARGN}
)
if(ABSL_CC_LIB_TESTONLY AND NOT (BUILD_TESTING AND ABSL_BUILD_TESTING))
if(NOT ABSL_CC_LIB_PUBLIC AND ABSL_CC_LIB_TESTONLY AND
NOT (BUILD_TESTING AND ABSL_BUILD_TESTING))
return()
endif()

@ -121,6 +121,7 @@ absl_cc_library(
absl::variant
GTest::gmock
GTest::gtest
PUBLIC
TESTONLY
)

Loading…
Cancel
Save