diff --git a/adm/cmake/jemalloc.cmake b/adm/cmake/jemalloc.cmake
index 579ed3e15..08917d94c 100644
--- a/adm/cmake/jemalloc.cmake
+++ b/adm/cmake/jemalloc.cmake
@@ -67,6 +67,7 @@ macro (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
 endmacro()
 
 macro (SEARCH_JEMALLOC)
+if(BUILD_LIBRARY_TYPE EQUAL "Static")
   # find static jemalloc lib
   SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
   if (WIN32)
@@ -76,10 +77,13 @@ macro (SEARCH_JEMALLOC)
     SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
     JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
   endif()
+endif()
   
+if(BUILD_LIBRARY_TYPE EQUAL "Shared")
   # find shared jemalloc lib
   SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
   JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")
+endif()
 endmacro()
 
 # Reset CSF variable
