diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4219c69b62..3ab7062019 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,29 @@ option(LIBVTERM_USE_STATIC "Use static libvterm" ON) find_package(LibVterm REQUIRED) include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS}) +option(SANITIZE "Enable Clang sanitizers for nvim binary" OFF) +if(SANITIZE AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang") + message(WARNING "SANITIZE is only supported for Clang ... disabling") + set(SANITIZE OFF) +endif() + +if(SANITIZE) + option(USE_JEMALLOC "Use jemalloc" OFF) +else() + option(USE_JEMALLOC "Use jemalloc" ON) +endif() + +if(USE_JEMALLOC) + option(JEMALLOC_USE_STATIC "Use static jemalloc" ON) + find_package(JeMalloc) + if(JEMALLOC_FOUND) + message(STATUS "Using jemalloc instead of libc allocator") + include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIRS}) + else() + set(USE_JEMALLOC OFF) + endif() +endif() + find_package(LibIntl) if(LibIntl_FOUND) include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS}) |