From 1830fe8833b1fe083aadabb2d1adc79ba86860ec Mon Sep 17 00:00:00 2001 From: Morgan Funtowicz Date: Tue, 19 Nov 2024 00:17:10 +0100 Subject: [PATCH] test(ctest) enable address sanitizer --- backends/trtllm/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backends/trtllm/CMakeLists.txt b/backends/trtllm/CMakeLists.txt index d33e9e8b..0b166e33 100644 --- a/backends/trtllm/CMakeLists.txt +++ b/backends/trtllm/CMakeLists.txt @@ -67,6 +67,11 @@ if (${TGI_TRTLLM_BACKEND_BUILD_TESTS}) target_link_libraries(tgi_trtllm_backend_tests PRIVATE CUDA::cudart CUDA::nvml) target_link_libraries(tgi_trtllm_backend_tests PRIVATE Catch2::Catch2WithMain tensorrt_llm nlohmann_json::nlohmann_json spdlog::spdlog) + if(CMAKE_BUILD_TYPE MATCHES "Debug") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -fsanitize=undefined -fsanitize=address") + target_link_options(tgi_trtllm_backend_tests BEFORE PUBLIC -fsanitize=undefined PUBLIC -fsanitize=address) + endif() + list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) include(CTest) include(Catch)