PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/cmake/GooglePerfTools.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 41 lines | 34 code | 4 blank | 3 comment | 8 complexity | 41391356c98415a0899b2eeb1e68f0d0 MD5 | raw file
 1# -*- cmake -*-
 2include(Prebuilt)
 3
 4if (STANDALONE)
 5  include(FindGooglePerfTools)
 6else (STANDALONE)
 7  if (WINDOWS)
 8    use_prebuilt_binary(tcmalloc)
 9    set(TCMALLOC_LIBRARIES 
10        debug libtcmalloc_minimal-debug
11        optimized libtcmalloc_minimal)
12    set(GOOGLE_PERFTOOLS_FOUND "YES")
13  endif (WINDOWS)
14  if (LINUX)
15    use_prebuilt_binary(tcmalloc)
16    set(TCMALLOC_LIBRARIES 
17    tcmalloc)
18    set(PROFILER_LIBRARIES profiler)
19    set(GOOGLE_PERFTOOLS_INCLUDE_DIR
20        ${LIBS_PREBUILT_DIR}/include)
21    set(GOOGLE_PERFTOOLS_FOUND "YES")
22  endif (LINUX)
23endif (STANDALONE)
24
25if (GOOGLE_PERFTOOLS_FOUND)
26  # XXX Disable temporarily, until we have compilation issues on 64-bit
27  # Etch sorted.
28  set(USE_GOOGLE_PERFTOOLS OFF CACHE BOOL "Build with Google PerfTools support.")
29endif (GOOGLE_PERFTOOLS_FOUND)
30
31if (WINDOWS)
32    set(USE_GOOGLE_PERFTOOLS ON)
33endif (WINDOWS)
34
35if (USE_GOOGLE_PERFTOOLS)
36  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1)
37  include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
38  set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES})
39else (USE_GOOGLE_PERFTOOLS)
40  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
41endif (USE_GOOGLE_PERFTOOLS)