Add support for tcmalloc

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-07-18 15:10:31 -07:00
parent 8353181fd1
commit 5de8b3a8ee

View file

@ -32,9 +32,18 @@ if (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES) endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
find_path(GMP_INCLUDE_DIR NAMES gmp.h ) find_path(GMP_INCLUDE_DIR NAMES gmp.h )
find_library(GMP_LIBRARIES NAMES gmp libgmp ) find_library(GMP_LIBRARIES NAMES gmp libgmp REQUIRED)
message(STATUS "GMP: " ${GMP_LIBRARIES}) message(STATUS "GMP: " ${GMP_LIBRARIES})
find_library(TCMALLOC_LIBRARY tcmalloc)
if (${TCMALLOC_LIBRARY} MATCHES "TCMALLOC_LIBRARY-NOTFOUND")
message("*** WARNING: failed to find tcmalloc")
message("*** The (optional) tcmalloc library is available at: https://code.google.com/p/gperftools")
else()
message("Found tcmalloc")
set(EXTRA_LIBS ${EXTRA_LIBS} ${TCMALLOC_LIBRARY})
endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES)
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES) mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)