From 0860131df404594ad46b70d4e79d1774ade9eaad Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sat, 29 Mar 2025 02:28:43 -0700 Subject: [PATCH] Update BuildMimalloc.cmake --- cmake/targets/BuildMimalloc.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake/targets/BuildMimalloc.cmake b/cmake/targets/BuildMimalloc.cmake index 408c81cfc9..650796b5f3 100644 --- a/cmake/targets/BuildMimalloc.cmake +++ b/cmake/targets/BuildMimalloc.cmake @@ -32,22 +32,29 @@ if(ENABLE_VALGRIND) endif() if(WIN32) - if(DEBUG) + if(DEBUG AND ENABLE_ASAN) + set(MIMALLOC_LIBRARY mimalloc-asan-static-debug) + elseif(DEBUG) set(MIMALLOC_LIBRARY mimalloc-static-debug) else() set(MIMALLOC_LIBRARY mimalloc-static) endif() +elseif(DEBUG AND ENABLE_ASAN) + set(MIMALLOC_LIBRARY mimalloc-asan-debug) elseif(DEBUG) set(MIMALLOC_LIBRARY mimalloc-debug) +elseif(ENABLE_ASAN) + set(MIMALLOC_LIBRARY mimalloc-asan) else() set(MIMALLOC_LIBRARY mimalloc) endif() # Workaround for linker issue on macOS and Linux x64 # https://github.com/microsoft/mimalloc/issues/512 -if(APPLE OR (LINUX AND NOT DEBUG)) - set(MIMALLOC_LIBRARY CMakeFiles/mimalloc-obj.dir/src/static.c.o) -endif() +# if(APPLE OR (LINUX AND NOT DEBUG)) +# set(MIMALLOC_LIBRARY CMakeFiles/mimalloc-obj.dir/src/static.c.o) +# endif() + register_cmake_command( TARGET