Simplify sanitizer flags in Linux CI workflow

Inline the SANITIZER_FLAGS expression into CXXFLAGS and drop CFLAGS.
c-test is the only C target and CMake links it with the C++ driver because
it depends on fmt-c, so the sanitizer runtime is still linked in.
This commit is contained in:
Victor Zverovich 2026-10-16 12:44:14 -07:00
parent 615acd84dd
commit 7a3b442edc

View File

@ -19,8 +19,6 @@ jobs:
# there is no need for timedatectl, which fails without systemd-timedated.
TZ: Europe/Kyiv
GTEST_DEATH_TEST_USE_FORK: ${{ matrix.sanitizers && startsWith(matrix.cxx, 'g++') && '1' || '0' }}
SANITIZER_FLAGS: >-
${{ matrix.sanitizers && '-fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize-recover=all' || '' }}
strategy:
matrix:
cxx: [g++-4.9, g++-11, clang++-3.6, clang++-11]
@ -204,8 +202,9 @@ jobs:
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{matrix.cxx}}
CFLAGS: ${{env.SANITIZER_FLAGS}}
CXXFLAGS: ${{matrix.cxxflags}} ${{env.SANITIZER_FLAGS}}
CXXFLAGS: >-
${{matrix.cxxflags}}
${{ matrix.sanitizers && '-fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize-recover=all' || '' }}
run: |
cmake ${{matrix.gen && '-G' || ''}} ${{matrix.gen}} \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \