diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/cmake/FindGooglePerfTools.cmake | 2 | ||||
-rwxr-xr-x | indra/cmake/GooglePerfTools.cmake | 38 | ||||
-rwxr-xr-x | indra/newview/CMakeLists.txt | 13 |
3 files changed, 36 insertions, 17 deletions
diff --git a/indra/cmake/FindGooglePerfTools.cmake b/indra/cmake/FindGooglePerfTools.cmake index 1c785d3461..bb125d538e 100755 --- a/indra/cmake/FindGooglePerfTools.cmake +++ b/indra/cmake/FindGooglePerfTools.cmake @@ -64,5 +64,3 @@ MARK_AS_ADVANCED( PROFILER_LIBRARY GOOGLE_PERFTOOLS_INCLUDE_DIR ) - -SET(GOOGLE_PERFTOOLS_FOUND "NO") diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake index 2e96912769..0c31d73655 100755 --- a/indra/cmake/GooglePerfTools.cmake +++ b/indra/cmake/GooglePerfTools.cmake @@ -1,20 +1,32 @@ # -*- cmake -*- include(Prebuilt) +# If you want to enable or disable TCMALLOC in viewer builds, this is the place. +# set ON or OFF as desired. +set (USE_TCMALLOC ON) + if (STANDALONE) include(FindGooglePerfTools) else (STANDALONE) if (WINDOWS) - use_prebuilt_binary(tcmalloc) - set(TCMALLOC_LIBRARIES - debug libtcmalloc_minimal-debug - optimized libtcmalloc_minimal) + if (USE_TCMALLOC) + use_prebuilt_binary(tcmalloc) + set(TCMALLOC_LIBRARIES + debug libtcmalloc_minimal-debug + optimized libtcmalloc_minimal) + else (USE_TCMALLOC) + set(TCMALLOC_LIBRARIES) + endif (USE_TCMALLOC) set(GOOGLE_PERFTOOLS_FOUND "YES") endif (WINDOWS) if (LINUX) - use_prebuilt_binary(tcmalloc) - set(TCMALLOC_LIBRARIES - tcmalloc) + if (USE_TCMALLOC) + use_prebuilt_binary(tcmalloc) + set(TCMALLOC_LIBRARIES + tcmalloc) + else (USE_TCMALLOC) + set(TCMALLOC_LIBRARIES) + endif (USE_TCMALLOC) set(PROFILER_LIBRARIES profiler) set(GOOGLE_PERFTOOLS_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include) @@ -29,13 +41,19 @@ if (GOOGLE_PERFTOOLS_FOUND) endif (GOOGLE_PERFTOOLS_FOUND) if (WINDOWS) - set(USE_GOOGLE_PERFTOOLS OFF) + set(USE_GOOGLE_PERFTOOLS ON) endif (WINDOWS) -if (USE_GOOGLE_PERFTOOLS) +# Apparently buggy - LL_USE_TCMALLOC never gets set. Fix when we have time to test the +# corresponding source code. +if (USE_TCMALLOC) set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1) +else (USE_TCMALLOC) + set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) +endif (USE_TCMALLOC) + +if (USE_GOOGLE_PERFTOOLS) include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR}) set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES}) else (USE_GOOGLE_PERFTOOLS) - set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) endif (USE_GOOGLE_PERFTOOLS) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 825cbbef8f..00cf1ba8df 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1505,12 +1505,15 @@ set(PACKAGE ON CACHE BOOL "Add a package target that builds an installer package.") if (WINDOWS) + if (USE_TCMALLOC) + set(TCMALLOC_INCLUDE_FLAGS "/INCLUDE:__tcmalloc") + else (USE_TCMALLOC) + set(TCMALLOC_INCLUDE_FLAGS) + endif (USE_TCMALLOC) + set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES - # *TODO -reenable this once we get server usage sorted out - #LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\"" -# LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc" - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS" + LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_INCLUDE_FLAGS}" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO" LINK_FLAGS_RELEASE "" ) @@ -1765,7 +1768,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${CRYPTO_LIBRARIES} ${LLLOGIN_LIBRARIES} ${LLCONVEXDECOMP_LIBRARY} -# ${TCMALLOC_LIBRARIES} + ${TCMALLOC_LIBRARIES} ) if (USE_KDU) |