From 4af38f894b579a4806835951137df4473c0a8cd0 Mon Sep 17 00:00:00 2001 From: Ed Sabol Date: Sun, 20 Nov 2022 23:23:41 -0500 Subject: [PATCH] Set CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS on gcc-9 and higher builds. --- .github/workflows/c-cpp.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 03f07d622..65342cc7c 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -31,6 +31,7 @@ jobs: CC: ${{ matrix.config.cc }}-${{ matrix.config.tag }} CXX: ${{ matrix.config.cxx }}-${{ matrix.config.tag }} GHA_CONTAINER: ${{ matrix.config.container }} + CCVERSION: ${{ matrix.config.tag }} steps: - name: if running in a container, update and install sudo, git, and other basics @@ -89,11 +90,28 @@ jobs: if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release fi + if [[ "${CC}" == gcc* ]] && [ "${CCVERSION}" -ge 9 ]; then + CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" + export CXXFLAGS + echo "CXXFLAGS: $CXXFLAGS" + fi ./bootstrap.sh -a - name: configure - run: ./configure --enable-ssl + run: | + if [[ "${CC}" == gcc* ]] && [ "${CCVERSION}" -ge 9 ]; then + CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" + export CXXFLAGS + echo "CXXFLAGS: $CXXFLAGS" + fi + ./configure --enable-ssl - name: make - run: ${CC} --version && make + run: | + if [[ "${CC}" == gcc* ]] && [ "${CCVERSION}" -ge 9 ]; then + CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" + export CXXFLAGS + echo "CXXFLAGS: $CXXFLAGS" + fi + ${CC} --version && make - name: make test run: ${CC} --version && make test - name: check test-suite.log