CMake: a TESTONLY library is not built if BUILD_TESTING is disabled.
envgap__abseil__abseil-cpp-997
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
04610889a913d29037205ca72e9d7fd7acc925fe- Manifest
absl/random/CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
abseil/abseil-cpp #997 · read the original issue
**Describe the bug** In my CMake project, I depend on Abseil, but have `BUILD_TESTING` disabled, so Abseil tests are not built. I have my own tests. In my tests I use GoogleTest/GoogleMock and Abseil. In particular, one of my tests depends on `absl::random_mocking_bit_gen` target. This target is a TESTONLY library that is meant to be used by any tests, including mine. But as I keep `BUILD_TESTING` disabled, TESTONLY libraries are not build and I'm unable to depend on Abseil test support code in my tests. Looks like building test support libraries should be separated from building full-fledged tests. **What build system are you using?** CMake
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]