From de6f641f28758fdbc7890735370adc961a34dc1d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 29 Sep 2020 13:42:47 +0200 Subject: [PATCH] cmake: use link_libraries() instead of add_link_options() for sanitizers --- CMake/CheckDebug.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/CheckDebug.cmake b/CMake/CheckDebug.cmake index 4ab87f25..2c873d86 100644 --- a/CMake/CheckDebug.cmake +++ b/CMake/CheckDebug.cmake @@ -49,7 +49,7 @@ function(check_debug) if(HAVE_ASAN) add_compile_definitions(HAVE_ASAN) add_compile_options(-fsanitize=address) - add_link_options(-lasan) + link_libraries(asan) check_flag(-fsanitize-recover=address IGNORE) endif() endif() @@ -62,7 +62,7 @@ function(check_debug) if(HAVE_UBSAN) add_compile_definitions(HAVE_UBSAN) add_compile_options(-fsanitize=undefined) - add_link_options(-lubsan) + link_libraries(ubsan) check_flag(-fsanitize-recover=undefined IGNORE) endif() endif() -- 2.30.2