Build with TCMalloc if available

This commit is contained in:
Vikram Rajkumar 2015-06-23 15:18:25 -04:00
parent 03c362b9e4
commit 0b854bc702
5 changed files with 24 additions and 26 deletions

View file

@ -2,11 +2,12 @@ add_executable( cli_wallet main.cpp )
if( UNIX AND NOT APPLE ) if( UNIX AND NOT APPLE )
set(rt_library rt ) set(rt_library rt )
endif() endif()
#find_package( Gperftools QUIET )
#if( GPERFTOOLS_FOUND ) find_package( Gperftools QUIET )
# message( STATUS "Found gperftools; compiling client with TCMalloc") if( GPERFTOOLS_FOUND )
# list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) message( STATUS "Found gperftools; compiling cli_wallet with TCMalloc")
#endif() list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()
target_link_libraries( cli_wallet target_link_libraries( cli_wallet
PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

View file

@ -2,11 +2,6 @@ add_executable( field_reflector main.cpp )
if( UNIX AND NOT APPLE ) if( UNIX AND NOT APPLE )
set(rt_library rt ) set(rt_library rt )
endif() endif()
#find_package( Gperftools QUIET )
#if( GPERFTOOLS_FOUND )
# message( STATUS "Found gperftools; compiling client with TCMalloc")
# list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
#endif()
target_link_libraries( field_reflector target_link_libraries( field_reflector
PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

View file

@ -2,11 +2,6 @@ add_executable( js_operation_serializer main.cpp )
if( UNIX AND NOT APPLE ) if( UNIX AND NOT APPLE )
set(rt_library rt ) set(rt_library rt )
endif() endif()
#find_package( Gperftools QUIET )
#if( GPERFTOOLS_FOUND )
# message( STATUS "Found gperftools; compiling client with TCMalloc")
# list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
#endif()
target_link_libraries( js_operation_serializer target_link_libraries( js_operation_serializer
PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) PRIVATE graphene_app graphene_net graphene_chain graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

View file

@ -2,11 +2,12 @@ add_executable( witness_node main.cpp )
if( UNIX AND NOT APPLE ) if( UNIX AND NOT APPLE )
set(rt_library rt ) set(rt_library rt )
endif() endif()
#find_package( Gperftools QUIET )
#if( GPERFTOOLS_FOUND ) find_package( Gperftools QUIET )
# message( STATUS "Found gperftools; compiling client with TCMalloc") if( GPERFTOOLS_FOUND )
# list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc ) message( STATUS "Found gperftools; compiling witness_node with TCMalloc")
#endif() list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()
target_link_libraries( witness_node target_link_libraries( witness_node
PRIVATE graphene_app graphene_account_history graphene_witness graphene_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) PRIVATE graphene_app graphene_account_history graphene_witness graphene_chain fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

View file

@ -1,21 +1,27 @@
file(GLOB COMMON_SOURCES "common/*.cpp") file(GLOB COMMON_SOURCES "common/*.cpp")
find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling tests with TCMalloc")
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()
file(GLOB UNIT_TESTS "tests/*.cpp") file(GLOB UNIT_TESTS "tests/*.cpp")
add_executable( chain_test ${UNIT_TESTS} ${COMMON_SOURCES} ) add_executable( chain_test ${UNIT_TESTS} ${COMMON_SOURCES} )
target_link_libraries( chain_test graphene_chain graphene_app graphene_account_history fc ) target_link_libraries( chain_test graphene_chain graphene_app graphene_account_history fc ${PLATFORM_SPECIFIC_LIBS} )
file(GLOB PERFORMANCE_TESTS "performance/*.cpp") file(GLOB PERFORMANCE_TESTS "performance/*.cpp")
add_executable( performance_test ${PERFORMANCE_TESTS} ${COMMON_SOURCES} ) add_executable( performance_test ${PERFORMANCE_TESTS} ${COMMON_SOURCES} )
target_link_libraries( performance_test graphene_chain graphene_app graphene_account_history fc ) target_link_libraries( performance_test graphene_chain graphene_app graphene_account_history fc ${PLATFORM_SPECIFIC_LIBS} )
file(GLOB BENCH_MARKS "benchmarks/*.cpp") file(GLOB BENCH_MARKS "benchmarks/*.cpp")
add_executable( chain_bench ${BENCH_MARKS} ${COMMON_SOURCES} ) add_executable( chain_bench ${BENCH_MARKS} ${COMMON_SOURCES} )
target_link_libraries( chain_bench graphene_chain graphene_account_history graphene_time fc ) target_link_libraries( chain_bench graphene_chain graphene_account_history graphene_time fc ${PLATFORM_SPECIFIC_LIBS} )
file(GLOB APP_SOURCES "app/*.cpp") file(GLOB APP_SOURCES "app/*.cpp")
add_executable( app_test ${APP_SOURCES} ) add_executable( app_test ${APP_SOURCES} )
target_link_libraries( app_test graphene_account_history graphene_app graphene_net graphene_chain graphene_time fc ) target_link_libraries( app_test graphene_account_history graphene_app graphene_net graphene_chain graphene_time fc ${PLATFORM_SPECIFIC_LIBS} )
file(GLOB INTENSE_SOURCES "intense/*.cpp") file(GLOB INTENSE_SOURCES "intense/*.cpp")
add_executable( intense_test ${INTENSE_SOURCES} ${COMMON_SOURCES} ) add_executable( intense_test ${INTENSE_SOURCES} ${COMMON_SOURCES} )
target_link_libraries( intense_test graphene_chain graphene_app graphene_account_history fc ) target_link_libraries( intense_test graphene_chain graphene_app graphene_account_history fc ${PLATFORM_SPECIFIC_LIBS} )