diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cd9c1ca0..924ec711f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,13 +47,15 @@ else() option(WITH_JEMALLOC "build with JeMalloc" OFF) if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") # FreeBSD has jemaloc as default malloc + # but it does not have all the jemalloc files in include/... set(WITH_JEMALLOC ON) - endif() - if(WITH_JEMALLOC) - find_package(JeMalloc REQUIRED) - add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) - include_directories(${JEMALLOC_INCLUDE_DIR}) - endif() + else() + if(WITH_JEMALLOC) + find_package(JeMalloc REQUIRED) + add_definitions(-DROCKSDB_JEMALLOC -DJEMALLOC_NO_DEMANGLE) + include_directories(${JEMALLOC_INCLUDE_DIR}) + endif() + endif() option(WITH_SNAPPY "build with SNAPPY" OFF) if(WITH_SNAPPY) find_package(snappy REQUIRED)