Skip to content

Commit

Permalink
cmake: use mimalloc instead of nedmalloc
Browse files Browse the repository at this point in the history
Just like in the regular GCC (MINGW) build, let's do the same in the
CMake (Visual C) build.

This is a long-overdue companion patch to
#4013

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Dec 21, 2023
1 parent 9cdc478 commit fd2e7bb
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
endif()
include_directories(${CMAKE_SOURCE_DIR}/compat/win32)
include_directories(${CMAKE_SOURCE_DIR}/compat/mimalloc)
add_compile_definitions(HAVE_ALLOCA_H NO_POSIX_GOODIES NATIVE_CRLF NO_UNIX_SOCKETS WIN32
_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe" NO_SYMLINK_HEAD UNRELIABLE_FSTAT
NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
USE_MIMALLOC OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
list(APPEND compat_SOURCES
compat/mingw.c
Expand All @@ -308,7 +309,21 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
compat/win32/trace2_win32_process_info.c
compat/win32/dirent.c
compat/win32/wsl.c
compat/nedmalloc/nedmalloc.c
compat/mimalloc/alloc-aligned.c
compat/mimalloc/alloc.c
compat/mimalloc/arena.c
compat/mimalloc/bitmap.c
compat/mimalloc/heap.c
compat/mimalloc/init.c
compat/mimalloc/options.c
compat/mimalloc/os.c
compat/mimalloc/page.c
compat/mimalloc/prim/windows/prim.o
compat/mimalloc/random.c
compat/mimalloc/segment.c
compat/mimalloc/segment-cache.c
compat/mimalloc/segment-map.o
compat/mimalloc/stats.c
compat/strdup.c
compat/win32/fscache.c)
set(NO_UNIX_SOCKETS 1)
Expand Down

0 comments on commit fd2e7bb

Please sign in to comment.