Skip to content

Commit

Permalink
[cmake] Enable address and undef. beh. sanitizer for tfel.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Nov 13, 2023
1 parent 40c720c commit 39113c1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/cmake/DependenciesExternalProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ if(OGS_USE_MFRONT)
"TFEL Python bindings disabled as Boosts Python library was not found."
)
endif()

if(ENABLE_ASAN)
list(APPEND _sanitize_flags -fsanitize=address)
endif()
if(ENABLE_UBSAN)
list(APPEND _sanitize_flags -fsanitize=undefined)
endif()
if(DEFINED _sanitize_flags)
list(JOIN _sanitize_flags " " _sanitize_flags_string)
foreach(var CXX EXE_LINKER SHARED_LINKER MODULE_LINKER)
list(APPEND _tfel_cmake_args
"-DCMAKE_${var}_FLAGS_INIT=${_sanitize_flags_string}"
)
endforeach()
endif()

BuildExternalProject(
TFEL ${_tfel_source}
CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
Expand Down

0 comments on commit 39113c1

Please sign in to comment.