diff --git a/CMakeLists.txt b/CMakeLists.txt index 09b945c9fb3..cc1a64a9e96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -393,7 +393,11 @@ else() endif () option (ENABLE_GWP_ASAN "Enable Gwp-Asan" ON) -if (NOT OS_LINUX AND NOT OS_ANDROID) +# We use mmap for allocations more heavily in debug builds, +# but GWP-ASan also wants to use mmap frequently, +# and due to a large number of memory mappings, +# it does not work together well. +if ((NOT OS_LINUX AND NOT OS_ANDROID) OR (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")) set(ENABLE_GWP_ASAN OFF) endif ()