diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b06d8bf..6db9330a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,6 +151,7 @@ jobs: platform: - Windows x86_64 - Linux x86_64 GCC + - Linux x86_64 GCC Sanitizer - Linux x86_64 Clang - macOS arm64 - macOS x86_64 @@ -166,6 +167,9 @@ jobs: preset: release - platform: Windows x86_64 runner: windows-latest + - platform: Linux x86_64 GCC Sanitizer + runner: ubuntu-24.04 + cmake-options: "-DMOMO_ENABLE_SANITIZER=On" - platform: Linux x86_64 GCC runner: ubuntu-24.04 - platform: Linux x86_64 Clang @@ -248,6 +252,7 @@ jobs: platform: - Windows x86_64 - Linux x86_64 GCC + - Linux x86_64 GCC Sanitizer - Linux x86_64 Clang - macOS arm64 - macOS x86_64 @@ -267,6 +272,8 @@ jobs: runner: windows-latest - platform: Linux x86_64 GCC runner: ubuntu-24.04 + - platform: Linux x86_64 GCC Sanitizer + runner: ubuntu-24.04 - platform: Linux x86_64 Clang runner: ubuntu-24.04 - platform: macOS arm64 diff --git a/cmake/compiler-env.cmake b/cmake/compiler-env.cmake index b5eb9255..1daa75fc 100644 --- a/cmake/compiler-env.cmake +++ b/cmake/compiler-env.cmake @@ -99,9 +99,8 @@ endif() ########################################## if(MOMO_ENABLE_SANITIZER) -momo_add_c_and_cxx_compile_options( - -fsanitize=address -) + momo_add_c_and_cxx_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) endif() ##########################################