]> granicus.if.org Git - graphviz/commitdiff
CI: manage ASan, UBSan enabling through env instead of 'use_sanitizers'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Jun 2022 05:00:09 +0000 (22:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Jun 2022 03:04:35 +0000 (20:04 -0700)
This will allow us more precise control over compiler flags. Managing these
through CMake settings is challenging when enabling these is toolchain dependent
(e.g. the existing `use_sanitizers` option does not work with MSVC) and
operating system dependent (e.g. ASan leak detection is enabled by default on
Linux but not on macOS).

Gitlab: #2200

.gitlab-ci.yml

index e833873a001d263561c9e055aa177bbababecd3a..126474245b218df3c496902c524b47d3acb03240 100644 (file)
@@ -754,9 +754,9 @@ ubuntu22-04-cmake-ASan-build-for-ctest:
     before_script:
         - export build_system="cmake"
         # fail on any compiler warnings
-        - export CFLAGS=-Werror
-        - export CXXFLAGS=-Werror
-        - export CMAKE_OPTIONS="-Duse_sanitizers=ON -Duse_coverage=ON -Dwith_cxx_tests=ON -Dwith_cxx_api=ON"
+        - export CFLAGS="-fsanitize=address,undefined -g -Werror"
+        - export CXXFLAGS="-fsanitize=address,undefined -g -Werror"
+        - export CMAKE_OPTIONS="-Duse_coverage=ON -Dwith_cxx_tests=ON -Dwith_cxx_api=ON"
         - export CMAKE_OPTIONS="$CMAKE_OPTIONS -Dwith_smyrna=ON"
     # override the deb_build_definition artifacts since we need more
     # files from the build directory when running ctest in the test