diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-09 06:03:12 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-09 06:03:12 +0000 |
commit | 87460ad6f67179bae58b90808fa75cee36ff1fdb (patch) | |
tree | 2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh | |
parent | a98bed7c37bbed320b1d4a270bf29fc9a538817c (diff) | |
parent | 7563023510bf04108a954596ea9393a4c11ac279 (diff) | |
download | webrtc-87460ad6f67179bae58b90808fa75cee36ff1fdb.tar.gz |
Snap for 8558685 from 7563023510bf04108a954596ea9393a4c11ac279 to tm-frc-extservices-releaset_frc_ext_330443000android13-frc-extservices-release
Change-Id: Iee8dd3827a6bd2f3d16f1fc31fee73d728883f14
Diffstat (limited to 'third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh')
-rwxr-xr-x[-rw-r--r--] | third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh index 38ad99f7ef..ab06aa0574 100644..100755 --- a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh +++ b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh @@ -14,48 +14,52 @@ # See the License for the specific language governing permissions and # limitations under the License. -# TODO(absl-team): This script isn't fully hermetic because -# -DABSL_USE_GOOGLETEST_HEAD=ON means that this script isn't pinned to a fixed -# version of GoogleTest. This means that an upstream change to GoogleTest could -# break this test. Fix this by allowing this script to pin to a known-good -# version of GoogleTest. - set -euox pipefail -if [ -z ${ABSEIL_ROOT:-} ]; then +if [[ -z ${ABSEIL_ROOT:-} ]]; then ABSEIL_ROOT="$(realpath $(dirname ${0})/..)" fi -if [ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]; then - ABSL_CMAKE_CXX_STANDARDS="11 14 17" +source "${ABSEIL_ROOT}/ci/cmake_common.sh" + +if [[ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]]; then + ABSL_CMAKE_CXX_STANDARDS="11 14 17 20" fi -if [ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]; then +if [[ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]]; then ABSL_CMAKE_BUILD_TYPES="Debug Release" fi +if [[ -z ${ABSL_CMAKE_BUILD_SHARED:-} ]]; then + ABSL_CMAKE_BUILD_SHARED="OFF ON" +fi + +source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh" +readonly DOCKER_CONTAINER=${LINUX_GCC_LATEST_CONTAINER} + for std in ${ABSL_CMAKE_CXX_STANDARDS}; do for compilation_mode in ${ABSL_CMAKE_BUILD_TYPES}; do - echo "--------------------------------------------------------------------" - echo "Testing with CMAKE_BUILD_TYPE=${compilation_mode} and -std=c++${std}" - - time docker run \ - --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \ - --workdir=/abseil-cpp \ - --tmpfs=/buildfs:exec \ - --cap-add=SYS_PTRACE \ - --rm \ - -e CFLAGS="-Werror" \ - -e CXXFLAGS="-Werror" \ - gcr.io/google.com/absl-177019/linux_gcc-latest:20200106 \ - /bin/bash -c " - cd /buildfs && \ - cmake /abseil-cpp \ - -DABSL_USE_GOOGLETEST_HEAD=ON \ - -DABSL_RUN_TESTS=ON \ - -DCMAKE_BUILD_TYPE=${compilation_mode} \ - -DCMAKE_CXX_STANDARD=${std} && \ - make -j$(nproc) && \ - ctest -j$(nproc) --output-on-failure" + for build_shared in ${ABSL_CMAKE_BUILD_SHARED}; do + time docker run \ + --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \ + --tmpfs=/buildfs:exec \ + --workdir=/buildfs \ + --cap-add=SYS_PTRACE \ + --rm \ + -e CFLAGS="-Werror" \ + -e CXXFLAGS="-Werror" \ + ${DOCKER_EXTRA_ARGS:-} \ + "${DOCKER_CONTAINER}" \ + /bin/bash -c " + cmake /abseil-cpp \ + -DABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL} \ + -DBUILD_SHARED_LIBS=${build_shared} \ + -DBUILD_TESTING=ON \ + -DCMAKE_BUILD_TYPE=${compilation_mode} \ + -DCMAKE_CXX_STANDARD=${std} \ + -DCMAKE_MODULE_LINKER_FLAGS=\"-Wl,--no-undefined\" && \ + make -j$(nproc) && \ + ctest -j$(nproc) --output-on-failure" + done done done |