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 --- ci/cmake_install_test.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ci') diff --git a/ci/cmake_install_test.sh b/ci/cmake_install_test.sh index 97ed8478..ab3b86f0 100755 --- a/ci/cmake_install_test.sh +++ b/ci/cmake_install_test.sh @@ -29,6 +29,18 @@ source "${ABSEIL_ROOT}/ci/cmake_common.sh" source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh" readonly DOCKER_CONTAINER=${LINUX_GCC_LATEST_CONTAINER} +# Verify that everything works with the standard "cmake && make && make install" +# without building tests or requiring GoogleTest. +time docker run \ + --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp-ro,readonly \ + --tmpfs=/buildfs:exec \ + --workdir=/buildfs \ + --rm \ + ${DOCKER_EXTRA_ARGS:-} \ + ${DOCKER_CONTAINER} \ + /bin/bash -c "cmake /abseil-cpp-ro && make -j$(nproc) && make install" + +# Verify that a more complicated project works. for link_type in ${LINK_TYPE}; do time docker run \ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp-ro,readonly \ -- cgit v1.2.3