diff --git a/CMakeLists.txt b/CMakeLists.txt index 28f7eb894a50b5345b9a0111a27a1a7b577b925d..91647d83bb2541b3a53d9e062a1d5a4bf5de177d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -511,7 +511,11 @@ if(HAVE_PTHREAD_MUTEX_ADAPTIVE_NP) endif() include(CheckCXXSymbolExists) -check_cxx_symbol_exists(malloc_usable_size malloc.h HAVE_MALLOC_USABLE_SIZE) +if(CMAKE_SYSTEM_NAME MATCHES "^FreeBSD") + check_cxx_symbol_exists(malloc_usable_size malloc_np.h HAVE_MALLOC_USABLE_SIZE) +else() + check_cxx_symbol_exists(malloc_usable_size malloc.h HAVE_MALLOC_USABLE_SIZE) +endif() if(HAVE_MALLOC_USABLE_SIZE) add_definitions(-DROCKSDB_MALLOC_USABLE_SIZE) endif()