summaryrefslogtreecommitdiff
path: root/indra/cmake/GooglePerfTools.cmake
blob: 6c784a3a76984be4e58e2a30eb9cc57cee83883d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- cmake -*-
include(Prebuilt)

if (STANDALONE)
  include(FindGooglePerfTools)
else (STANDALONE)
  if (WINDOWS)
    use_prebuilt_binary(google-perftools)
    set(TCMALLOC_LIBRARIES 
        debug libtcmalloc_minimal-debug
        optimized libtcmalloc_minimal)
    set(GOOGLE_PERFTOOLS_FOUND "YES")
  endif (WINDOWS)
  if (LINUX)
    use_prebuilt_binary(google-perftools)
    set(TCMALLOC_LIBRARIES tcmalloc)
    set(PROFILER_LIBRARIES profiler)
    set(GOOGLE_PERFTOOLS_INCLUDE_DIR
        ${LIBS_PREBUILT_DIR}/include)
    set(GOOGLE_PERFTOOLS_FOUND "YES")
  endif (LINUX)
endif (STANDALONE)

if (GOOGLE_PERFTOOLS_FOUND)
  # XXX Disable temporarily, until we have compilation issues on 64-bit
  # Etch sorted.
  set(USE_GOOGLE_PERFTOOLS OFF CACHE BOOL "Build with Google PerfTools support.")
endif (GOOGLE_PERFTOOLS_FOUND)

if (WINDOWS)
    # *TODO -reenable this once we get server usage sorted out
    #set(USE_GOOGLE_PERFTOOLS ON)
endif (WINDOWS)

if (USE_GOOGLE_PERFTOOLS)
  set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
  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)