option to link with jemalloc on *nix, off by default.
[blender-staging.git] / build_files / cmake / macros.cmake
index ca1dd79cd8e6020a190f01f53f0a8f99e5951ed2..8a1f6875b6fe71a0956dc45443f57034450f9275 100644 (file)
@@ -114,6 +114,9 @@ macro(SETUP_LIBDIRS)
                link_directories(${PCRE_LIBPATH})
                link_directories(${EXPAT_LIBPATH})
        endif()
+       if(WITH_MEM_JEMALLOC)
+               link_directories(${JEMALLOC_LIBPATH})
+       endif()
 
        if(WIN32 AND NOT UNIX)
                link_directories(${PTHREADS_LIBPATH})
@@ -220,6 +223,9 @@ macro(setup_liblinks
                        target_link_libraries(${target} optimized ${LCMS_LIB})
                endif()
        endif()
+       if(WITH_MEM_JEMALLOC)
+               target_link_libraries(${target} ${JEMALLOC_LIBRARY})
+       endif()
        if(WIN32 AND NOT UNIX)
                target_link_libraries(${target} ${PTHREADS_LIB})
        endif()