/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 -*-
  2. include(Prebuilt)
  3. if (STANDALONE)
  4. include(FindGooglePerfTools)
  5. else (STANDALONE)
  6. if (WINDOWS)
  7. use_prebuilt_binary(tcmalloc)
  8. set(TCMALLOC_LIBRARIES
  9. debug libtcmalloc_minimal-debug
  10. optimized libtcmalloc_minimal)
  11. set(GOOGLE_PERFTOOLS_FOUND "YES")
  12. endif (WINDOWS)
  13. if (LINUX)
  14. use_prebuilt_binary(tcmalloc)
  15. set(TCMALLOC_LIBRARIES
  16. tcmalloc)
  17. set(PROFILER_LIBRARIES profiler)
  18. set(GOOGLE_PERFTOOLS_INCLUDE_DIR
  19. ${LIBS_PREBUILT_DIR}/include)
  20. set(GOOGLE_PERFTOOLS_FOUND "YES")
  21. endif (LINUX)
  22. endif (STANDALONE)
  23. if (GOOGLE_PERFTOOLS_FOUND)
  24. # XXX Disable temporarily, until we have compilation issues on 64-bit
  25. # Etch sorted.
  26. set(USE_GOOGLE_PERFTOOLS OFF CACHE BOOL "Build with Google PerfTools support.")
  27. endif (GOOGLE_PERFTOOLS_FOUND)
  28. if (WINDOWS)
  29. set(USE_GOOGLE_PERFTOOLS ON)
  30. endif (WINDOWS)
  31. if (USE_GOOGLE_PERFTOOLS)
  32. set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1)
  33. include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
  34. set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES})
  35. else (USE_GOOGLE_PERFTOOLS)
  36. set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
  37. endif (USE_GOOGLE_PERFTOOLS)